Skip to content

nicheinc/migration-to-jest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Migration to Jest - Automation of the easy parts

The script automates parts of the migration from our current testing suites to jest. It is based on the code developed by Contactually. The story underlying this code can be found in this blog post.

The script uses jest-codemods. The file to test is from and egghead lesson (the code itself is available on Github).

The script runs in 3 parts, automatically committing the changes in-between:

  1. It copies the test files .spec.js into the folder test and rename them with the extension test.js
  2. It applies several transformers from jest-codemods
  3. It replaces ad-hoc test expressions by jest expressions

The script and the process to run it is still a work in progress. For now

  1. Copy the script file mocha-and-sinon-to-jest.js to the directory where the tests you want to convert are.
  2. Run node mocha-and-sinon-to-jest.js .
  3. A new directory __test__ should be added to the directory with the converted test files in it.

Releases

No releases published

Packages

No packages published