Top "Chai" questions

Chai is a BDD/TDD assertion library for Node.

Comparing arrays in chai

I'm writing some tests with chai and chai-as-promised (and more frameworks, but it doesn't matter in this case) and I …

arrays node.js chai
How to correctly close express server between tests using mocha and chai

I am looking for a correct way to completely reset my express server between tests! It seems that this is …

node.js express mocha.js chai chai-http
How to provide chai expect with custom error message for mocha unit test?

I have a mocha test using chai's expect: it("should parse sails out of cache file", async () => { const sailExtractor = …

javascript node.js typescript chai
Files upload testing in Enzyme

I have a FileInput in my render function <FileInput accept= "image/jpeg,image/png,audio/mp3" onChange= {this.fileInputOnChange} …

reactjs mocha sinon chai enzyme
Mocha/Chai testing expected vs actual arrays of objects

What's the best way to assert that the expected results matches the actual results when both are arrays of objects? …

javascript testing mocha.js matcher chai
Chai.js - Check if string contains substring from a list

I'm using chai.js writing some automation tests. I have a string: url(http://somewhere.com/images/myimage.png) I …

chai
How to unit test file upload with Supertest -and- send a token?

How can I test a file upload with a token being sent? I'm getting back "0" instead of a confirmation of …

unit-testing mocha.js endpoint chai supertest
chai js expect property value empty array

I'm trying to write a unit test using chai js assertion, and was wondering how to expect arrays with zero …

javascript mocha chai
How to write unit test for the function which is accessing aws resources?

I have a function which is accessing multiple aws resources and now need to test this function, but I don't …

node.js amazon-web-services mocha.js chai aws-sdk-mock
How to get "should.be.false" syntax pass jslint?

I am writing JS UT for my NodeJS code. I am using Chai as the assertion library, and I prefer …

node.js jslint chai