Codemod to add missing tests
Large projects without tests are hard to maintain and extend. Run this codemod to find untested code and create default tests.
The codemod:
- Supports 10 entities in Ember and Ember Data
- Accounts for TypeScript,
<template>tag, and route splitting - Blazingly fast compared to Ember CLI
Step 1. Quickly migrate.
cd <path/to/your/project>
npx ember-codemod-add-missing-tests <arguments>Step 2. Review the package.
- Fix format and lint errors.
- Run the new integration and unit tests. Update assertions or skip tests as needed.
Optional: Specify the component structure
By default, an Octane project has the flat component structure. Pass --component-structure to indicate otherwise.
npx ember-codemod-add-missing-tests --component-structure nestedOptional: Specify the project root
Pass --root to run the codemod somewhere else (i.e. not in the current directory).
npx ember-codemod-add-missing-tests --root <path/to/your/project>Optional: Specify the test-app location
By default, the codemod creates tests in the package where it is run. Pass --test-app-location to override the logic.
npx ember-codemod-add-missing-tests --test-app-location ../../tests/my-v2-addonThe codemod is designed to cover typical cases. It is not designed to cover one-off cases.
To better meet your needs, consider cloning the repo and running the codemod locally.
cd <path/to/cloned/repo>
# Compile TypeScript
pnpm build
# Run codemod
./dist/bin/ember-codemod-add-missing-tests.js --root <path/to/your/project>- Node.js v20 or above
See the Contributing guide for details.
This project is licensed under the MIT License.