Skip to content

Tag: mocha.js

mocha test passes even though I throw error

in this block of code “err” is being printed, and the test passes. also tried – and done(). nothing worked, test is still passing every time. why is this happening? Answer Option 1: await the promise Just add await before the promise expression. You don’t even need those then and catch. Option 2: return the promise If you just return