{"id":19816750,"url":"https://github.com/welldone-software/babel-plugin-react-add-test-id","last_synced_at":"2025-10-08T00:53:02.230Z","repository":{"id":43982267,"uuid":"245084351","full_name":"welldone-software/babel-plugin-react-add-test-id","owner":"welldone-software","description":null,"archived":false,"fork":false,"pushed_at":"2023-06-17T02:43:11.000Z","size":635,"stargazers_count":5,"open_issues_count":15,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-05T07:21:21.766Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/welldone-software.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,"zenodo":null}},"created_at":"2020-03-05T06:16:43.000Z","updated_at":"2024-07-30T14:52:51.000Z","dependencies_parsed_at":"2024-11-12T10:10:36.888Z","dependency_job_id":"8111d34f-8b84-4dea-ab01-b77fe9aceb0c","html_url":"https://github.com/welldone-software/babel-plugin-react-add-test-id","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/welldone-software/babel-plugin-react-add-test-id","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/welldone-software%2Fbabel-plugin-react-add-test-id","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/welldone-software%2Fbabel-plugin-react-add-test-id/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/welldone-software%2Fbabel-plugin-react-add-test-id/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/welldone-software%2Fbabel-plugin-react-add-test-id/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/welldone-software","download_url":"https://codeload.github.com/welldone-software/babel-plugin-react-add-test-id/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/welldone-software%2Fbabel-plugin-react-add-test-id/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278872154,"owners_count":26060525,"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","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-12T10:10:31.640Z","updated_at":"2025-10-08T00:53:02.214Z","avatar_url":"https://github.com/welldone-software.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# babel-plugin-react-add-test-id\n\n## Example\n\n#### in\n\n```\nconst Foo = () =\u003e\n  \u003cBar\u003e\n    \u003cdiv\u003e\n  \u003c/Bar\u003e\n```\n\n#### out\n\n```\nconst Foo = () =\u003e\n  \u003cBar data-test-id=\"Foo-Bar\"\u003e\n    \u003cdiv data-test-id=\"Foo-Bar-div\"\u003e\n  \u003c/Bar\u003e\n```\n\n## Useful with styled-components\n\n#### in\n\n```\nconst Wrapper = styled.div`...`\n\nconst Bar = styled.div`...`\n\nconst Foo = () =\u003e\n  \u003cWrapper\u003e\n    \u003cBar\u003e\n  \u003c/Wrapper\u003e\n```\n\n#### out\n\n```\nconst Wrapper = styled.div`...`\n\nconst Bar = styled.div`...`\n\nconst Foo = () =\u003e\n  \u003cWrapper data-test-id=\"Foo-Wrapper\"\u003e\n    \u003cBar data-test-id=\"Foo-Wrapper-Bar\"\u003e\n  \u003c/Wrapper\u003e\n```\n\n## Install\n\n`yarn add @welldone-software/babel-plugin-react-add-test-id`\n\nor\n\n`npm install @welldone-software/babel-plugin-react-add-test-id`\n\n## Usage\n\nin .babelrc\n\n```\n\"plugins\": [\n  \"@welldone-software/babel-plugin-add-test-id\",\n  ...\n```\n\n## Options\n\n| Property                 | Type             | Default                                                                                                                                           | Description                                 |\n| ------------------------ | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------- |\n| attrName                 | String           | `data-test-id`                                                                                                                                    | Define the attribute name                   |\n| mode                     | String           | `regular`                                                                                                                                         | One of `minimal`, `regular`, `full`         |\n| ignoreElements           | Array of Strings | [`div`, `input`, `a`, `button`, `span`, `p`, `br`, `hr`, `ul`, `ol`, `li`, `img`, `form`, `h1`, `h2`, `h3`, `h4`, `h5`, `h6`, `svg`, `path`, `g`] | Avoid adding test id on those elements      |\n| additionalIgnoreElements | Array of Strings | []                                                                                                                                                | Add extra ignoreElements                    |\n| delimiter                | String           | `-`                                                                                                                                               | Separate components name with the delimiter |\n\nin .babelrc\n\n```\n\"plugins\": [\n  [\"@welldone-software/babel-plugin-add-test-id\", {\"attrName\": \"data-test-id-example\"}],\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwelldone-software%2Fbabel-plugin-react-add-test-id","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwelldone-software%2Fbabel-plugin-react-add-test-id","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwelldone-software%2Fbabel-plugin-react-add-test-id/lists"}