title | excerpt |
---|---|
Chai |
an assertion library used with a JavaScript testing framework |
Chai is a Behavior Driven Development (BDD) / Test Driven Development (TDD) assertion library for Node.js and the browser. It can be paired with any JavaScript testing framework, such as Mocha.
The Chai assertion library allows you to write assertions in the classical form: assert.typeOf(foo, 'string')
, but where Chai shines is its chain-capable style which makes writing assertions very readable: expect(foo).to.be.a('string')
.