{"id":17168690,"url":"https://github.com/sanix-darker/testa","last_synced_at":"2025-04-13T15:42:49.149Z","repository":{"id":45264550,"uuid":"185791582","full_name":"Sanix-Darker/testa","owner":"Sanix-Darker","description":"A POC for testing your code, only with comments.","archived":false,"fork":false,"pushed_at":"2024-05-21T06:31:22.000Z","size":961,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T13:19:15.630Z","etag":null,"topics":["automated-tests","developpers","json","python","test","test-automation","test-driven-development","test-framework","test-runner","testing","testing-framework","testing-tools","testng","tests"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sanix-Darker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-09T12:07:56.000Z","updated_at":"2025-01-29T08:34:54.000Z","dependencies_parsed_at":"2022-08-27T19:50:21.601Z","dependency_job_id":null,"html_url":"https://github.com/Sanix-Darker/testa","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sanix-Darker%2Ftesta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sanix-Darker%2Ftesta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sanix-Darker%2Ftesta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sanix-Darker%2Ftesta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sanix-Darker","download_url":"https://codeload.github.com/Sanix-Darker/testa/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248740221,"owners_count":21154248,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automated-tests","developpers","json","python","test","test-automation","test-driven-development","test-framework","test-runner","testing","testing-framework","testing-tools","testng","tests"],"created_at":"2024-10-14T23:12:34.457Z","updated_at":"2025-04-13T15:42:49.108Z","avatar_url":"https://github.com/Sanix-Darker.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Testa\n\nTesta is the best, simple Test tool \"CrossPlatform\" and \"CrossLanguages\" (Only Script languages supported for now),\n develop by developpers for developpers based on comments in your code.\nThe power in this tool is that the grammar is the same for all your implementation languages.\n\n**Note:** This project is completly experimental, am still working on it, not sure where am going with it lol.\n\n## Features\n\n- Testa can do any Unittest you want from an assertion.\n- Testa Can Save Your Tests reports so that you can check it later in a persistant file.\n- Testa is light and simple because it is based on comments in your code.\n- Testa have a specific and very simple grammar for testing \"all methods\" presents in a file in one time and generate reports.\n- Testa is build from scratch so it doesn't have any dependency or any kind of troubleshooting with potentials externals libs.\n- Testa can generate for you a small and readable documentation whatever the language you're using\n\n## Testa can test all theese programming languages\n\nList of languages, where you can perform testa test:\n\n- [Done] Python\n- [Done] Javascript\n- [Done] PHP\n- [Done] Ruby\n\n## Documentation\nSome few things to know before using testa.\n\n## How to config it\n\n### Config files\n\nYou need to config a `testa.json`.\n\n- An example of testa config file for `Javascript`:\n```json\n{\n    \"module\": \"ta-js\",\n    \"path\": [\"./square.js\", \"./my_javascript_app/\"],\n    \"extensions\": [\".js\"],\n    \"launcher\": \"node\"\n}\n```\nps : in `path` parameter, you can define either a file or a directory\n\n- An example of testa config file for `PHP`:\n```json\n{\n    \"module\": \"ta-php\",\n    \"path\": [\"./square.php\"],\n    \"extensions\": [\".php\"],\n    \"launcher\": \"php\"\n}\n```\n- An example of testa config file for `python`:\n```json\n{\n    \"module\": \"ta-py\",\n    \"path\": [\"./sha256.py\", \"./square.py\"],\n    \"extensions\": [\".py\"],\n    \"launcher\": \"python\"\n}\n```\n- An example of testa config file for `Ruby`:\n```json\n{\n    \"module\": \"ta-rb\",\n    \"path\": [\"./my_ruby_app/\", \"./square.rb\"],\n    \"extensions\": [\".rb\"],\n    \"launcher\": \"ruby\"\n}\n```\n\n### Legend\n    \n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003cth\u003eParameter\u003c/th\u003e\n        \u003cth\u003eExample\u003c/th\u003e\n        \u003cth\u003eMeaning\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003cb\u003epath\u003c/b\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003cb\u003e\u003ci\u003e[\"./javascript/square.js\", \"./javascript/my_javascript_app/\"]\u003c/i\u003e\u003c/b\u003e\u003c/td\u003e\n        \u003ctd\u003eAll path where testa will perform tests.\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e \u003cb\u003eextensions\u003c/b\u003e \u003c/td\u003e\n        \u003ctd\u003e \u003cb\u003e\u003ci\u003e[\".js\"]\u003c/i\u003e\u003c/b\u003e \u003c/td\u003e\n        \u003ctd\u003e All file extensions to be tests. \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e \u003cb\u003elauncher\u003c/b\u003e \u003c/td\u003e\n        \u003ctd\u003e \u003cb\u003e\u003ci\u003e\"node\"\u003c/i\u003e\u003c/b\u003e \u003c/td\u003e\n        \u003ctd\u003e The program responsible fo launching the script in command line. \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e \u003cb\u003eoutputMethod\u003c/b\u003e \u003c/td\u003e\n        \u003ctd\u003e \u003cb\u003e\u003ci\u003e\"console.log\"\u003c/i\u003e\u003c/b\u003e \u003c/td\u003e\n        \u003ctd\u003e The default print/log for the appropriate language. \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e \u003cb\u003ecommentStartBy\u003c/b\u003e \u003c/td\u003e\n        \u003ctd\u003e \u003cb\u003e\u003ci\u003e\"//\"\u003c/i\u003e\u003c/b\u003e \u003c/td\u003e\n        \u003ctd\u003e The default started comment character. \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e \u003cb\u003etryCatch\u003c/b\u003e \u003c/td\u003e\n        \u003ctd\u003e \u003cb\u003e\u003ci\u003e\"try{ \\n\\t **** \\n}catch(err){ \\n\\t console.log(es);}\"\u003c/i\u003e\u003c/b\u003e \u003c/td\u003e\n        \u003ctd\u003e A oneline try catch to get errors when the code crash, the **** will be were the code will be place. \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e \u003cb\u003efunction\u003c/b\u003e \u003c/td\u003e\n        \u003ctd\u003e \u003cb\u003e\u003ci\u003e\"\"\u003c/i\u003e\u003c/b\u003e \u003c/td\u003e\n        \u003ctd\u003e The function name synthax like function or def. \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e \u003cb\u003evarDeclaration\u003c/b\u003e \u003c/td\u003e\n        \u003ctd\u003e \u003cb\u003e\u003ci\u003e[\"var\", \"let\", \"const\"]\u003c/i\u003e\u003c/b\u003e \u003c/td\u003e\n        \u003ctd\u003e The prefix on instantiation of a variable. \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e \u003cb\u003eclassInstantiationNew\u003c/b\u003e \u003c/td\u003e\n        \u003ctd\u003e \u003cb\u003e\u003ci\u003e\"new\"\u003c/i\u003e\u003c/b\u003e \u003c/td\u003e\n        \u003ctd\u003e The keyword synthax instantiation. \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e \u003cb\u003eAccoladeStart\u003c/b\u003e \u003c/td\u003e\n        \u003ctd\u003e \u003cb\u003e\u003ci\u003e\"{\"\u003c/i\u003e\u003c/b\u003e \u003c/td\u003e\n        \u003ctd\u003e This define the start of a function or a class. \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e \u003cb\u003eAccoladeEnd\u003c/b\u003e \u003c/td\u003e\n        \u003ctd\u003e \u003cb\u003e\u003ci\u003e\"}\"\u003c/i\u003e\u003c/b\u003e \u003c/td\u003e\n        \u003ctd\u003e This define the end of a method or a class. \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e \u003cb\u003eNoneNull\u003c/b\u003e \u003c/td\u003e\n        \u003ctd\u003e \u003cb\u003e\u003ci\u003e\"none\"\u003c/i\u003e\u003c/b\u003e \u003c/td\u003e\n        \u003ctd\u003e None for python and null for javascript. \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e \u003cb\u003eselfOrThis\u003c/b\u003e \u003c/td\u003e\n        \u003ctd\u003e \u003cb\u003e\u003ci\u003e\"this\"\u003c/i\u003e\u003c/b\u003e \u003c/td\u003e\n        \u003ctd\u003e self for python and this for javascript for example. \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e \u003cb\u003eselfOnFunctionParams\u003c/b\u003e \u003c/td\u003e\n        \u003ctd\u003e \u003cb\u003e\u003ci\u003efalse\u003c/i\u003e\u003c/b\u003e \u003c/td\u003e\n        \u003ctd\u003e The 'self' or 'this' parameter present on method. \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e \u003cb\u003esemicolon\u003c/b\u003e \u003c/td\u003e\n        \u003ctd\u003e \u003cb\u003e\u003ci\u003e\";\"\u003c/i\u003e\u003c/b\u003e \u003c/td\u003e\n        \u003ctd\u003e  For thoose langage that supporting instructions only with a \";\" (semicolon). \u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n\n## How to install it\n\nTo install testa, it's really simple, you just have to run:\n```shell\npip install tsta\n\n# Then cd to the directory tha tcontain your testa.json file \n# and run :\ntsta\n# That's all, a report will be generated\n```\n\n## How to use it\n\nIn your code, make sure to enclose the instructions you want to test with the testa grammar, for example:\n- In Python:\n\n```python\n# For a Simple assertion:\n\n# ::import_start::\n# --- Your imports here, if your methods need them ---\n# ::import_end::\n\n# ::testa_start::\n# ::case_start::\n# \u003e\u003e testa.isEqual(2, 2)\n# \u003c\u003c true\n# ::case_end::\n# ::testa_end::\n\n#\n# ::doc_start::\n#  .\n#  Here a small description of the function  that will be generate on the documentation\n#  .\n# ::doc_end::\n#\n\n# With methods :\n\n# ::testa_start::\n# ::case_start::\n# \u003e\u003e addition(2, 2)\n# \u003c\u003c 4\n# ::case_end::\n# ::code_start::\ndef addition(a, b):\n    return a+b\n# ::code_end::\n# ::testa_end::\n```\n\n- In Javascript:\n \n```javascript\n\n// ::import_start::\n// --- Your imports here ---\n// ::import_end::\n\n// For a Simple assertion:\n\n// ::testa_start::\n// ::case_start::\n// \u003e\u003e testa.isEqual(2, 2)\n// \u003c\u003c true\n// ::case_end::\n// ::testa_end::\n\n\n// For more instructions:\n\n// ::testa_start::\n// ::case_start::\n// \u003e\u003e addition(2, 2)\n// \u003c\u003c 4\n// ::case_end::\n\n//\n// ::doc_start::\n//  .\n//  Here a small description of the function  that will be generate on the documentation\n//  .\n// ::doc_end::\n//\n\n// ::code_start::\n// --- Your specific list of instruction / functions source code here!\nfunction addition(a, b){\n    return a+b\n}\n// ::code_end::\n// ::testa_end::\n```\n\n- In php :\n\n```php\n// ::testa_start::\n// ::case_start::\n// \u003e\u003e square(9)\n// \u003c\u003c 3\n// ::case_end::\n// ::code_start::\nfunction square($a){\n    return sqrt($a);\n}\n// ::code_end::\n// ::testa_end::\n```\n\n- In Ruby :\n\n```ruby\n# ::testa_start::\n# ::case_start::\n# \u003e\u003e square(9)\n# \u003c\u003c 3.0\n# ::case_end::\n# ::code_start::\ndef square(a)\n    return a/2\n# ::code_end::\n# ::testa_end::\n```\n\nAnd that's where the magic of Testa is, for any language, you have only to write a simple JSON file and specify paths where you will do tests.\n\n## Author\n\n- Sanix darker\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanix-darker%2Ftesta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsanix-darker%2Ftesta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanix-darker%2Ftesta/lists"}