I am using mocha, chai, supertest & nyc for my test cases. All of my test cases are working as expected. But I am not able to see the total count of test cases at the end.
21 passing (150ms) // <--- these counts are missing in console
1 failing (150ms) // <--- these counts are missing in console
I am not able to see how many test cases are passed (or failed). It just executes them all and quit the process.
This is how my test cases are structured:
describe("GET /", () => {
it("should return all users", async () => {
await model.insertMany(users);
const res = await request(app).get("/users");
expect(res.status).to.equal(200);
expect(res.body.data.length).to.equal(2);
});
});
And this is how run it: with npm test
:
"scripts": {
"start": "node index.js",
"test": "NODE_ENV=test nyc --reporter=html --reporter=text mocha --exit --timeout 15000"
}
Version:
node - v11.15.0
npm - 6.7.0
mocha - 6.2.1
chai - 4.2.0
nyc - 14.1.1
supertest - 4.0.2
Any leads will be appreciated :)