Skip to content

🍵 Codemod for jscodeshift to migrate your tests from Jasmine to Chai syntax

License

Notifications You must be signed in to change notification settings

vansosnin/jasmine-to-chai-codemod

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jasmine to Chai Codemod

Build Status

Codemod for jscodeshift to migrate your tests from Jasmine to Chai syntax.

Use case

This transform may be useful if you have relatively many tests on Jasmine framework and want to change to some other framework with Chai support or maybe just add Chai syntax.

Install

  • npm i -g jscodeshift to install jscodeshift globally
  • Install/clone/download this repository

Usage

jscodeshift <your-tests-path> -t <codemod-script>

For more info see jscodeshift documentation.

Try it

Known limitations

  • Does not transform spies. Chai has no built-in spies. Look into Sinon.
  • Does not transfrom jasmine.clock(). Chai has no built-in timer mocking. Look into Lolex.
  • Does not handle more complex uses of jasmine.any(). No equivalent feature in Chai. Look into chai-match-pattern.
  • Does not handle jasmine.stringMatching(), .arrayContaining(), .objectContaining().
  • Does not handle .toBeGreaterThan(), .toBeLessThan(), .toBeCloseTo(). Haven't bothered to implement yet.

About

🍵 Codemod for jscodeshift to migrate your tests from Jasmine to Chai syntax

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published