September 2017
Intermediate to advanced
450 pages
11h 24m
English
The expect assertions within Chai are known as Behavior Driven Development (BDD). This style of assertion is completely oriented around the behavior of your application's state, and is written in a manner that makes it very easy to understand which behavior is being tested for. Chai also supports another BDD style assertion keyword, the should assertion:
let should = chai.should();Foobar.should.be.a('string'); Foobar.should.equal('foobar'); Foobar.should.have.lengthOf(6);http.get(123, function (err, data) { should.not.exist(err); should.exist(data); data.should.be.an('object'); });
The should assertion is an alternative way in Mocha to write the same types of Chai assertions as the expect assertion keyword, but with what ...
Read now
Unlock full access