{"id":28451234,"url":"https://github.com/wonderflow-bv/to-ava","last_synced_at":"2025-06-30T22:32:42.597Z","repository":{"id":47982785,"uuid":"200539099","full_name":"wonderflow-bv/to-ava","owner":"wonderflow-bv","description":"Convert Jest tests into Ava tests","archived":false,"fork":false,"pushed_at":"2023-01-04T06:16:12.000Z","size":496,"stargazers_count":6,"open_issues_count":9,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-06T16:11:26.267Z","etag":null,"topics":["ava","codemod","jest"],"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/wonderflow-bv.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}},"created_at":"2019-08-04T20:35:17.000Z","updated_at":"2024-06-14T20:46:59.000Z","dependencies_parsed_at":"2023-02-02T01:01:47.311Z","dependency_job_id":null,"html_url":"https://github.com/wonderflow-bv/to-ava","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/wonderflow-bv/to-ava","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wonderflow-bv%2Fto-ava","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wonderflow-bv%2Fto-ava/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wonderflow-bv%2Fto-ava/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wonderflow-bv%2Fto-ava/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wonderflow-bv","download_url":"https://codeload.github.com/wonderflow-bv/to-ava/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wonderflow-bv%2Fto-ava/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262861404,"owners_count":23376227,"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":["ava","codemod","jest"],"created_at":"2025-06-06T16:10:16.303Z","updated_at":"2025-06-30T22:32:42.582Z","avatar_url":"https://github.com/wonderflow-bv.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# to-ava\n\nCodemod to convert tests written in jest to ava.\n\nCheck `fixtures/` folder to see some example.\n\n## Usage\n\n### Install\n\n`npm i -g to-ava`\n\n### Run it on a Javascript file\n\n`to-ava ./jest.test.js`\n\n### Run it on a Typescript file\n\n`to-ava -p=ts ./jest.test.ts`\n\n### Run it on a folder\n\n`to-ava -p=ts ./tests`\n\n### Notes\n\nIt excludes files that are not test files. A file is supposed to contain tests if its name includes either `test.` either `spec.`\n\n## Support\n\n### Supported Assertions\n\n- [X] `.toEqual`\n- [X] `.toBe`\n- [X] `.toBeNull`\n- [X] `.toBeFalsy`\n- [X] `.toBeTruthy`\n- [X] `.toMatchSnapshot`\n- [X] `.toBeDefined`\n- [X] `.toBeUndefined`\n- [X] `.toBeInstanceOf`\n- [X] `.toBeGreaterThan`\n- [X] `.toBeGreaterThanOrEqual`\n- [X] `.toBeLessThan`\n- [X] `.toBeLessThanOrEqual`\n- [X] `.toHaveLength`\n- [X] `.toHaveProperty`\n\n### Other things supported\n\n- [X] `test.each()`\n- [X] trasnformation of test hooks (`before()`, `beforeEach()`, `after()`, `afterAll()`)\n\n### Assertions not supported\n\nAll the other assertions are not supported. Including all the assertions used in combination with `.not` - for example `.not.toBeDefined()`\n\nThose assertions will be still transformed, however not into an ava assertion, but as a comment with the \"TODO: \" symbol. Thanks for the \"TODO: \" symbol, it will be possible to find all the assertions not transformed, and fix them manually.\n\nFor example\n\n```js\nexpect(res).toContain('0')\n\n// will be transformed into\n\n// TODO: expect(res).toContain('0');\n```\n\n### Other things not supported\n\n- [ ] nested `describe()` - require manual rewriting of jest tests in order to remove nested `describe()`\n- [ ] skipped tests `describe.skip()`, `it.skip()`\n\n## Test\n\n`npm t`\n\n\n\n## TODO\n\n- [X] add support for beforeEach, beforeAll, afterEach, afterAll\n- [ ] refactor: split the transformer into multiple functions, with clear names\n- [ ] add support for more jest assertion. The list follows:\n  - [ ] `.not.toBeDefined`\n  - [ ] `.not.toBeNull`\n  - [ ] `.not.toContain`\n  - [ ] `.not.toEqual`\n- [ ] add support for nested describes\n\n## Resources\n\n- [Ava to Jest transformers](https://github.com/skovhus/jest-codemods/blob/master/src/transformers/ava.js)\n- [AST Explorer](https://astexplorer.net/)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwonderflow-bv%2Fto-ava","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwonderflow-bv%2Fto-ava","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwonderflow-bv%2Fto-ava/lists"}