I’m using Chai.js. I have the following assertion
it('Expects subjects in the response body', () => {
expect(response.body).to.be.an('object').that.includes.key("subjects");
expect(response.body.subjects).to.be.an('array').that.has.lengthOf.at.least(1);
});
This doesn’t pass I get an error message saying Cannot read property 'least' of undefined
But the following works fine.
it('Expects subjects in the response body', () => {
expect(response.body).to.be.an('object').that.includes.key("subjects");
expect(response.body.subjects).to.be.an('array').that.has.lengthOf(10);
});
So how am I using .at.least()
incorrectly?