Codemod for jscodeshift to migrate your tests from Jasmine to Chai syntax.
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.
npm i -g jscodeshift
to install jscodeshift globally- Install/clone/download this repository
jscodeshift <your-tests-path> -t <codemod-script>
For more info see jscodeshift documentation.
- 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.