Uh oh!
There was an error while loading. Please reload this page.
test: wrap expectsError in mustCall - #14088
Conversation
67c6580 to
9d4451dCompareTrott
commented
Jul 5, 2017
@nodejs/testing |
refack
commented
Jul 6, 2017
BridgeAR
commented
Jul 8, 2017
Documentation added |
refack
commented
Jul 8, 2017
@BridgeAR I've rebased at refack@0c31246 PTAL |
5d16d64 to
d950bebComparerefack
commented
Jul 8, 2017
Wrap expectsError in mustCall to make sure it's really called as expected. PR-URL: nodejs#14088 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
d950beb to
1b2733fCompareExtra sanity on |
jasnell
commented
Jul 10, 2017
I missed this PR because I was on vacation last week. I'm not a fan of this at all and now have to go through and refactor a number of http2 tests I've written to account for this. For example, there are a couple of tests where an error might be reported and should only be checked if it actually is. For those, I've done What would have been better is adding an option such that: common.expectsError({code: '...',type: Error,message: '...',mustCall: 2});Wherein if the |
BridgeAR
commented
Jul 10, 2017
@jasnell hm, instead of making the mustCall optional, I think it would be better to explicitly opt-out of that. So maybe a good follow up PR would be to add a |
jasnell
commented
Jul 10, 2017
-1 to opt out. The semantics of |
BridgeAR
commented
Jul 10, 2017
So far there was not a single test that was not a |
|
refack
commented
Jul 10, 2017
jasnell
commented
Jul 10, 2017
I'm already fixing the tests. It's not all bad :-) ... it did help me find a bug in a test that I accidentally had not completed 100%, but there are a couple of cases where this change is a bit unfortunate. For instance, in one case, whether or not the |
BridgeAR
commented
Jul 11, 2017
@jasnell as you already fixed the tests and also had a benefit because of this: do you still want to revert it? |
gibfahn
commented
Jul 11, 2017
I guess we could have an alternate function that doesn't do the |
I don't want to 👎 but it seems like the case mentioned above is an exception to the rule, and shouldn't necessitate a new method. As usual the discussion if getting fragmented #14159 (comment). Gist:
|
gibfahn
commented
Jul 11, 2017
Agreed that if it's only used in 1 or 2 places it's probably not worth pulling it out into I was thinking about whether you could just use 👎 is fine, polite disagreement is what it's there for! |
addaleax
commented
Jul 22, 2017
This doesn’t land cleanly on 8.x; if you can, please follow the guide and raise a backport PR. |
MylesBorins
commented
Nov 16, 2017
Should this be backported to |
BridgeAR
commented
Dec 11, 2017
This function does not exist in v.6 so backporting is obsolete. |
To make sure that all expectsError calls are indeed called, wrap them in mustCall.
By doing so I found one obsolete expectsError call in the tests.
I think it's nice to have the exact number of calls but having a minimum would also be good if the churn is unwanted.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
test