Skip to content
This repository has been archived by the owner on Nov 4, 2020. It is now read-only.

Breaking change for rejectedWith #185

Open
cloverb opened this issue Jul 9, 2019 · 3 comments
Open

Breaking change for rejectedWith #185

cloverb opened this issue Jul 9, 2019 · 3 comments

Comments

@cloverb
Copy link

cloverb commented Jul 9, 2019

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

@btd
Copy link
Member

btd commented Jul 10, 2019

Your code does not throw for me

@cloverb
Copy link
Author

cloverb commented Jul 10, 2019

Did you run it in the repl.it?

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

@btd
Copy link
Member

btd commented Aug 22, 2019

Is this still actual?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants