When I give this statement as below, an "Uncaught AssertionError: .empty was passed non-string primitive 1" is thrown expect(res.body.invoiceDetails.lineItems[0].invLineId).to.be.a('Number').and.not.to.be.empty;
Try not.to.be.null instead of not.to.be.empty
According to the chai documentation, .empty checks weather an array is empty or if a string has a length of 0:
.empty
When the target is a string or array, .empty asserts that the target’s length property is strictly (===) equal to 0.
It looks like you are expecting 'res.body.invoiceDetails.lineItems[0].invLineId' to be a number so the assertion is failing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With