should.js icon indicating copy to clipboard operation
should.js copied to clipboard

Breaking change for rejectedWith

Open cloverb opened this issue 6 years ago • 3 comments

Node.js 10.14.0 Should.js version 13.2.3

Repro here: https://repl.it/@cloverb/WeirdWeepySpheres

AssertionError: expected [Promise] to be rejected: expected CustomError {} to match CustomError {}

rejectedWith no longer works with custom errors because it calls match which then does an isPlainObject call which checks the object prototype. This is a breaking change from earlier versions. Is there a reason you are requiring the prototype to be Object.prototype or null?

https://github.com/shouldjs/should.js/blob/master/should.js#L3168 -> https://github.com/shouldjs/should.js/blob/master/should.js#L4055 -> https://github.com/shouldjs/should.js/blob/master/should.js#L1429

cloverb avatar Jul 09 '19 20:07 cloverb

Your code does not throw for me

btd avatar Jul 10 '19 09:07 btd

Did you run it in the repl.it?

Screen Shot 2019-07-10 at 12 29 54 PM

cloverb avatar Jul 10 '19 16:07 cloverb

Is this still actual?

btd avatar Aug 22 '19 09:08 btd