ember-codemod-add-missing-tests
v1.1.6
Published
Codemod to add missing tests
Readme
ember-codemod-add-missing-tests
Codemod to add missing tests
Why use it?
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
Usage
Step 1. Quickly migrate.
cd <path/to/your/project>
npx ember-codemod-add-missing-tests <arguments>Step 2. Review the package.
- [x] Fix format and lint errors.
- [x] Run the new integration and unit tests. Update assertions or skip tests as needed.
Arguments
By default, an Octane project has the flat component structure. Pass --component-structure to indicate otherwise.
npx ember-codemod-add-missing-tests --component-structure nestedPass --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>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-addonLimitations
The 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>Compatibility
- Node.js v20 or above
Contributing
See the Contributing guide for details.
License
This project is licensed under the MIT License.
