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
1) should throw an error if we fail to pass baseURI:
AssertionError: expected [Function] to throw 'Error: baseURI option is required' but 'Error: baseURI option is required' was thrown
it('should throw an error if we fail to pass baseURI',()=>{expect(()=>{letapi=newAPI();}).to.throw(newError('baseURI option is required'));});
and this doesn't work either
it('should throw an error if we fail to pass baseURI',()=>{expect(newAPI).to.throw(newError('baseURI option is required'));});
The text was updated successfully, but these errors were encountered:
expect(newAPI).to.throw('baseURI option is required');
doesn't work either
I'm also using dirty-chai
test/support/index.js: (this gets required in `mocha.opts)
// setup global chai methodsimportchaifrom'chai';importdirtyChaifrom'dirty-chai';chai.config.includeStack=true;chai.config.showDiff=true;chai.use(dirtyChai);global.AssertionError=chai.AssertionError;global.Assertion=chai.Assertion;global.expect=chai.expect;global.assert=chai.assert;
Since we've got #683 merged, this one has been solved.
You can read more about our decisions on this matter reading this post, and the previous one.
But basically this is related to the behavior when using an Error for the check. When doing this, Chai does a strict (===) comparison to check if both instances are the same.
and this doesn't work either
The text was updated successfully, but these errors were encountered: