Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4.x: backport test: use mustCall() for simple flow tracking #10465

Closed
wants to merge 1 commit into from

Conversation

targos
Copy link
Member

@targos targos commented Dec 26, 2016

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

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>
@targos targos added test Issues and PRs related to the tests. v4.x labels Dec 26, 2016
@nodejs-github-bot nodejs-github-bot added test Issues and PRs related to the tests. v4.x labels Dec 26, 2016
Copy link
Contributor

@MylesBorins MylesBorins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rubber stamp LGTM if CI is green

@targos
Copy link
Member Author

targos commented Dec 26, 2016

@MylesBorins
Copy link
Contributor

whole bunch of failures on BSD for this on

one more ci run: https://ci.nodejs.org/job/node-test-pull-request/5600/

@targos
Copy link
Member Author

targos commented Dec 27, 2016

CI is green this time

@targos
Copy link
Member Author

targos commented Dec 28, 2016

landed in 5b87f09

@targos targos closed this Dec 28, 2016
@targos targos deleted the backport-7753-v4.x branch December 28, 2016 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants