You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In mochajs/mocha#1635, we are considering adding support for suite continuation if a hook throws an AssertionError.
Because expect.js doesn't actually throw an AssertionError upon failure, this feature will simply not work with expect.js.
Would like to start a discussion about expect.js throwing AssertionErrors, much like Chai or should. I imagine:
in a server context, use require('assert').AssertionError
in a client context, the assertion library must define a global AssertionError. Example:
varAssertionError=function(message,actual,expected){this.message=message;this.actual=actual;this.expected=expected;this.showDiff=true;};// or whatever you need to do for old browser supportAssertionError.prototype=Object.create(Error.prototype);AssertionError.prototype.name='AssertionError';AssertionError.prototype.constructor=AssertionError;
Would this break backwards compatibility? Any user checks of err instanceof Error should still work.
The text was updated successfully, but these errors were encountered:
In mochajs/mocha#1635, we are considering adding support for suite continuation if a hook throws an
AssertionError
.Because expect.js doesn't actually throw an
AssertionError
upon failure, this feature will simply not work with expect.js.Would like to start a discussion about expect.js throwing
AssertionError
s, much like Chai or should. I imagine:in a server context, use
require('assert').AssertionError
in a client context, the assertion library must define a global
AssertionError
. Example:Would this break backwards compatibility? Any user checks of
err instanceof Error
should still work.The text was updated successfully, but these errors were encountered: