v4.x: backport test: use mustCall() for simple flow tracking#10465
Closed
targos wants to merge 1 commit intonodejs:v4.x-stagingfrom
Closed
v4.x: backport test: use mustCall() for simple flow tracking#10465targos wants to merge 1 commit intonodejs:v4.x-stagingfrom
targos wants to merge 1 commit intonodejs:v4.x-stagingfrom
Conversation
Many of the tests use variables to track when callback functions are invoked or events are emitted. These variables are then asserted on process exit. This commit replaces this pattern in straightforward cases with common.mustCall(). This makes the tests easier to reason about, leads to a net reduction in lines of code, and uncovered a few bugs in tests. This commit also replaces some callbacks that should never be called with common.fail(). PR-URL: nodejs#7753 Reviewed-By: Wyatt Preul <wpreul@gmail.com> Reviewed-By: Minwoo Jung <jmwsoft@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
MylesBorins
approved these changes
Dec 26, 2016
Contributor
MylesBorins
left a comment
There was a problem hiding this comment.
rubber stamp LGTM if CI is green
Member
Author
Contributor
|
whole bunch of failures on BSD for this on one more ci run: https://ci.nodejs.org/job/node-test-pull-request/5600/ |
Member
Author
|
CI is green this time |
Member
Author
|
landed in 5b87f09 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a backport of #7753.
I decided to do this because it touches a lot of test files and recent test refactors don't apply cleanly to v4.x because they are based on those changes.
/cc @nodejs/lts