chai-truthy
Truthy and Falsy FUNCTIONS for Chai BDD
Why?
- Because
expect(foo).to.be.ok
is error-prone. Typo thatok
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
chai; // Not necessary in the browser if using globals var foo = 42;tobe; var bar = '';tobe;