Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vansosnin/jasmine-to-chai-codemod
:tea: Codemod for jscodeshift to migrate your tests from Jasmine to Chai syntax
https://github.com/vansosnin/jasmine-to-chai-codemod
chai-codemod codemod jasmine-codemod javascript jscodeshift
Last synced: 12 days ago
JSON representation
:tea: Codemod for jscodeshift to migrate your tests from Jasmine to Chai syntax
- Host: GitHub
- URL: https://github.com/vansosnin/jasmine-to-chai-codemod
- Owner: vansosnin
- License: mit
- Created: 2016-07-14T07:56:50.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-28T12:53:24.000Z (about 7 years ago)
- Last Synced: 2024-11-02T21:31:43.089Z (3 months ago)
- Topics: chai-codemod, codemod, jasmine-codemod, javascript, jscodeshift
- Language: JavaScript
- Homepage:
- Size: 34.2 KB
- Stars: 6
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-codemods - jasmine-to-chai-codemod - Codemod for jscodeshift to migrate your tests from Jasmine to Chai syntax. (Misc / ant-design)
README
# Jasmine to Chai Codemod
[![Build Status](https://travis-ci.org/vansosnin/jasmine-to-chai-codemod.svg?branch=master)](https://travis-ci.org/vansosnin/jasmine-to-chai-codemod)
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 -t `
For more info see [jscodeshift] documentation.
## Try it
* [Import 'expect' sandbox]
* [Assertions sandbox]## 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.[jscodeshift]: https://github.com/facebook/jscodeshift
[Import 'expect' sandbox]: https://astexplorer.net/#/gist/3f2de7f7a4e3b6c16fd3e21256332bbc/fa4054baca48de14f0ba8e49dd8b8fdeb17dc3a5
[Assertions sandbox]: https://astexplorer.net/#/gist/bb80fb0d9fca0241d91daccd83ea9b84/7cdf19c1e241ea872f4fb8d2518a41d8ea8c1da5
[Sinon]: http://sinonjs.org/
[Lolex]: https://github.com/sinonjs/lolex
[chai-match-pattern]: http://chaijs.com/plugins/chai-match-pattern/