{"id":15974557,"url":"https://github.com/malithmcr/testing-library-codegen","last_synced_at":"2025-04-04T17:12:59.793Z","repository":{"id":97358993,"uuid":"471526142","full_name":"malithmcr/testing-library-codegen","owner":"malithmcr","description":"WIP: A tool for generating test based on tsx 🤖","archived":false,"fork":false,"pushed_at":"2022-03-30T18:33:48.000Z","size":83,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-10T02:24:43.899Z","etag":null,"topics":["testing"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/malithmcr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-18T21:49:18.000Z","updated_at":"2023-03-08T14:24:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"a0daf855-cf5e-49d4-bd5e-1febe13a5442","html_url":"https://github.com/malithmcr/testing-library-codegen","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/malithmcr%2Ftesting-library-codegen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malithmcr%2Ftesting-library-codegen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malithmcr%2Ftesting-library-codegen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malithmcr%2Ftesting-library-codegen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/malithmcr","download_url":"https://codeload.github.com/malithmcr/testing-library-codegen/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247217221,"owners_count":20903009,"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":["testing"],"created_at":"2024-10-07T21:42:45.602Z","updated_at":"2025-04-04T17:12:59.767Z","avatar_url":"https://github.com/malithmcr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🤖 testing-library-codegen 🤖\n\nTesting-library-codegen is a tool where can detect and generate the test files for you by analyzing the JSX or TSX file.\n\n\n# The Problem\n\nWhen it comes to testing a React application, Developers spend good amount of time rewriting the same boilerplate code. \n\n# The Solution\nGoal of this package is to help developers \nto improve productiviy. Let them foucs on the real test. Testing-library-codegen will take care of the basics. \n\n\n\nThe test file will contain empty tests by statically analyzing the code,behaving like a coverage tool by figuring out all the ways it could be run (e.g. isCool needs to be true to go in this if statement)\n\nIt can't actually build functional tests or figure out what they're supposed to output, but it could at least provide some sort of boilerplate to manually verify.\n\nExample input.js:\n```\nexport default function (sayHello) {\n    if(sayHello) {\n        return 'hello';\n    }\n}\nexport function strLength (str) {\n    return str.length;\n}\n```\nExample generated-tests.js:\n```\nimport test from 'ava';\nimport camelizedModuleName, {strLength} from '.';\n\ntest('return undefined',t =\u003e {\n    t.same(camelizedModuleName(), undefined);\n});\n\ntest('return hello', t =\u003e {\n    t.same(camelizedModuleName(true), 'hello');\n});\n\ntest(TBD, t =\u003e { // \"TBD\" would be something the dev would have to replace\n    t.same(strLength(TBD), TBD);\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalithmcr%2Ftesting-library-codegen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmalithmcr%2Ftesting-library-codegen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalithmcr%2Ftesting-library-codegen/lists"}