jest-codemods
Codemods for Jest that simplify migrating to Jest. Currently only from Tape.
![MIT License][license-badge]
Codemods are small programs that help you automate changes to your codebase. Think of them as search and replace on steroids. They are executed by the Facebook jscodeshift tool.
Install
$ npm install --global jest-codemods
This installs a binary tape-to-jest
.
Tape to Jest codemod
Currently we support migrating from Tape to Jest.
$ tape-to-jest --help
Usage
$ tape-to-jest <path> [options]
path Files or directory to transform. Can be a glob like src/**.test.js
Options
--force, -f Bypass Git safety checks and forcibly run codemods
--dry, -d Dry run (no changes are made to files)
--parser The parser to use for parsing your source files (babel | babylon | flow) [babel]
To transform all test files in a directory run tape-to-jest mySrcFolder
in your terminal. Only files requiring or importing tape will be transformed. Notice the console output for errors, manual intervention might be required.
Inspiration
Thanks to ava-codemods for inspiration.
License
MIT