so this test no matter what I do, doesn't fail.
it("should not save the user(duplicate user)", function (done) {
const user = {
name: "faruk",
email: "faruk@farukmail.com",
password: "faruk2356",
};
model.saveUser(user, function (err, doc) {
expect(err).to.exist;
done()
});
});
If I Console.log the error it shows this:
AssertionError: expected null to exist.
So there is an error but the test doesn't fail. and the errors isn't even related to the save user function it's the error that chai throws. how is that even possible when I console.log(err) it logs not the error callback gives but the error chai throws. I can't understand what is going on here.