chai test if null code example
Example 1: chai test throw error
expect(model.get.bind(model, 'z')).to.throw('Property does not exist in model schema.');
expect(model.get.bind(model, 'z')).to.throw(new Error('Property does not exist in model schema.'));
Example 2: chai expect to be type array
expect([1, 2]).to.be.an('array');