New issue
Advanced search Search tips

Issue 701812 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 672152



Sign in to add a comment

should.beRejected() should accept an expected error

Project Member Reported by rtoy@chromium.org, Mar 15 2017

Issue description

Currently should.beRejected() doesn't take any argument.  As long as the promise is rejected, the test passes.  However, it would be beneficial if beRejected() took an argument specifying the expected error type, just like we do for should.throw().

 

Comment 1 by rtoy@chromium.org, Mar 16 2017

Nope.  Use beRejectedWith().

Although this makes it rather inconsistent with throw() which takes an arg.  To be consistent we should have throwWith().  Or beRejectedWith() should be removed and beRejected() can take an arg.

Not sure what needs to be done here. Can you clarify?

Comment 3 by rtoy@chromium.org, Mar 19 2018

I think it should be consistent.  beRejected() should take an arg like throw() does.  Or make throw() not take an arg and add throwWith() that does, to match beRejectedWith().

I have a slight preference for beRejected() taking an optional arg, like throw().

This is less than P3.

Sign in to add a comment