A jscodeshift codemod that transforms test files from AVA to Jest.
I no longer maintain this package. As a great, more feature complete alternative, I recommend https://github.com/skovhus/jest-codemods.
Get jscodeshift-ava-to-jest
from NPM
npm install --save-dev jscodeshift-ava-to-jest
TBD: Explain how this module can be used in an existing project.
It all started with a tweet, followed by a suggestion by Christoph Pojer.
-
.pass([message])
-
.fail([message])
-
.truthy(value, [message])
-
.falsy(value, [message])
-
.true(value, [message])
-
.false(value, [message])
-
.is(value, expected, [message])
-
.not(value, expected, [message])
-
.deepEqual(value, expected, [message])
-
.notDeepEqual(value, expected, [message])
-
.throws(function|promise, [error, [message]])
-
.notThrows(function|promise, [message])
-
.regex(contents, regex, [message])
-
.notRegex(contents, regex, [message])
-
.ifError(error, [message])
ava-tests
: Contains tests written in AVA.
jest-tests
: Contains generated Jest files.
src
: Contains jscodeshift
helper functions.
transform.js
: The entry point for jscodeshift
.
npm test
: Transforms tests from AVA to Jest. In more detail:
- Runs
ava
on all files inava-tests
to make sure the AVA tests are valid. - Deletes all files in
jest-tests
. - Copies all files from
ava-tests
tojest-tests
. - Runs
jscodeshift
on all files injest-tests
. - Runs
jest
on all files injest-tests
to make sure the Jest tests are valid.