Commit 04b4d15b authored by cjihrig's avatar cjihrig
Browse files

test: use mustCall() for simple flow tracking

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: https://github.com/nodejs/node/pull/7753


Reviewed-By: default avatarWyatt Preul <wpreul@gmail.com>
Reviewed-By: default avatarMinwoo Jung <jmwsoft@gmail.com>
Reviewed-By: default avatarBen Noordhuis <info@bnoordhuis.nl>
parent 59741a9b
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment