Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/twada/chai-to-assert
A jscodeshift codemod that transforms from chai to Node assert
https://github.com/twada/chai-to-assert
Last synced: about 1 month ago
JSON representation
A jscodeshift codemod that transforms from chai to Node assert
- Host: GitHub
- URL: https://github.com/twada/chai-to-assert
- Owner: twada
- License: mit
- Created: 2017-01-18T09:18:28.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-12T06:14:52.000Z (almost 8 years ago)
- Last Synced: 2025-01-10T06:08:59.318Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 67.4 KB
- Stars: 15
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-codemods - chai-to-assert - A jscodeshift codemod that transforms from chai to Node assert. (JavaScript)
README
chai-to-assert
================================A [jscodeshift](https://github.com/facebook/jscodeshift) codemod that transforms from [chai](http://chaijs.com/) to [Node assert](https://nodejs.org/api/assert.html).
[![Build Status][travis-image]][travis-url]
[![NPM version][npm-image]][npm-url]
[![Code Style][style-image]][style-url]
[![License][license-image]][license-url]USAGE
---------------------------------------```sh
$ npm install -g jscodeshift
$ npm install chai-to-assert
$ jscodeshift -t node_modules/chai-to-assert/lib/bdd-api-to-node-assert.js target-dir
```FEATURES
---------------------------------------### BDD Style API
* `expect`
* `should`#### properties
* `.ok`
* `.true`
* `.false`
* `.null`
* `.undefined`
* `.exist`
* `.NaN`
* `.finite`
* `.extensible`
* `.sealed`
* `.frozen`#### chainable methods
* `.a(type)` (alias `an`) (only for primitives and null)
* `.lengthOf(value)` (alias `.length`)#### methods
* `.equal(value)` (alias `.equals`, `.eq`)
* `.eql(value)` (alias `.eqls`)
* `.match(regexp)` (alias `.matches`)
* `.above(value)` (alias `.gt`, `.greaterThan`)
* `.least(value)` (alias `.gte`)
* `.below(value)` (alias `.lt`, `.lessThan`)
* `.most(value)` (alias `.lte`)
* `.within(start, finish)`
* `.closeTo(expected, delta)` (alias `.approximately`)
* `.property(name, [value])`
* `.ownProperty(name, [value])` (alias `.haveOwnProperty`)
* `.ownPropertyDescriptor(name, [descriptor])` (alias `.haveOwnPropertyDescriptor`)
* `.instanceof(constructor)` (alias `.instanceOf`)
* `.throw([errorLike], [errMsgMatcher])` (alias `.throws`, `.Throw`)
* `.respondTo(method)` (alias `.respondsTo`)
* `.satisfy(predicate)` (alias `.satisfies`)
* `.string(string)`
* `.oneOf(list)`AUTHOR
---------------------------------------
* [Takuto Wada](https://github.com/twada)LICENSE
---------------------------------------
Licensed under the [MIT](https://github.com/twada/chai-to-assert/blob/master/LICENSE) license.[npm-url]: https://npmjs.org/package/chai-to-assert
[npm-image]: https://badge.fury.io/js/chai-to-assert.svg[travis-url]: https://travis-ci.org/twada/chai-to-assert
[travis-image]: https://secure.travis-ci.org/twada/chai-to-assert.svg?branch=master[license-url]: https://github.com/twada/chai-to-assert/blob/master/LICENSE
[license-image]: https://img.shields.io/badge/license-MIT-brightgreen.svg[style-url]: https://github.com/Flet/semistandard
[style-image]: https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg