Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikeyburkman/chai-truthy
Truthy FUNCTIONS for Chai
https://github.com/mikeyburkman/chai-truthy
Last synced: 15 days ago
JSON representation
Truthy FUNCTIONS for Chai
- Host: GitHub
- URL: https://github.com/mikeyburkman/chai-truthy
- Owner: MikeyBurkman
- License: mit
- Created: 2017-03-15T18:24:13.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-03-15T18:30:16.000Z (over 7 years ago)
- Last Synced: 2024-11-01T02:07:33.397Z (15 days ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# chai-truthy
Truthy and Falsy **FUNCTIONS** for [Chai BDD](http://chaijs.com/api/bdd/)### Why?
* Because `expect(foo).to.be.ok` is error-prone. Typo that `ok` bit and your assertion will ALWAYS pass.
* By adding a `truthy()` function, if you make a typo, the function won't exist, it'll throw an error,
and you'll know immediately that you goofed up.### API
```js
chai.use(require('chai-truthy')); // Not necessary in the browser if using globalsvar foo = 42;
expect(foo).to.be.truthy();var bar = '';
expet(bar).to.be.falsy();
```