should().beRejected() should take an error arg to specify the error? |
|||
Issue descriptionIf a promise is rejected with an error, should().beRejected() doesn't allow the test to specify the type of error. Should it? This makes it match should().throw().
,
Jan 5 2017
We don't have to add it. Just that some tests were written handle the rejected promise and then also checked the reason why. Option [c] is ok if we make the arg required.
,
Jan 6 2017
Option [c] means we have to fix the existing beRejected() assertion. Is it what we want?
,
Jan 6 2017
Are you saying [c] would replace all existing current uses of beRejected()? That wasn't my intent, but we could. But then I would say beRejectedWith() would need to support no arg for the cases where we don't care. I'm ok with having both beRejected() and beRejectedWith(required). There is still the option of not doing anything.
,
Jan 23 2017
,
Jan 24 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/9f0467f5ac93ea19f8ded30cf82fc68f538e7ad1 commit 9f0467f5ac93ea19f8ded30cf82fc68f538e7ad1 Author: hongchan <hongchan@chromium.org> Date: Tue Jan 24 02:43:27 2017 This CL adds should().beRejectedWith() so you can specify the expected error type. BUG= 678723 TEST= LayoutTests/webaudio/unit-tests/audit.html LayoutTests/webaudio/unit-tests/audit-failures.html Review-Url: https://codereview.chromium.org/2654673003 Cr-Commit-Position: refs/heads/master@{#445617} [modify] https://crrev.com/9f0467f5ac93ea19f8ded30cf82fc68f538e7ad1/third_party/WebKit/LayoutTests/webaudio/resources/audit.js [modify] https://crrev.com/9f0467f5ac93ea19f8ded30cf82fc68f538e7ad1/third_party/WebKit/LayoutTests/webaudio/unit-tests/audit-expected.txt [modify] https://crrev.com/9f0467f5ac93ea19f8ded30cf82fc68f538e7ad1/third_party/WebKit/LayoutTests/webaudio/unit-tests/audit-failures-expected.txt [modify] https://crrev.com/9f0467f5ac93ea19f8ded30cf82fc68f538e7ad1/third_party/WebKit/LayoutTests/webaudio/unit-tests/audit-failures.html [modify] https://crrev.com/9f0467f5ac93ea19f8ded30cf82fc68f538e7ad1/third_party/WebKit/LayoutTests/webaudio/unit-tests/audit.html
,
Jan 24 2017
|
|||
►
Sign in to add a comment |
|||
Comment 1 by hongchan@chromium.org
, Jan 5 2017