Skip to content

Commit

Permalink
test: better assertion for async hook tests
Browse files Browse the repository at this point in the history
The existing assertion was misleading to whether there were too few or
too many events of a particular type. Improve the assertion message.

PR-URL: #27601
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
ofrobots authored and antsmartian committed May 12, 2019
1 parent f60afa6 commit a244b6f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/async-hooks/verify-graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ module.exports = function verifyGraph(hooks, graph) {

for (const type in expTypes) {
assert.strictEqual(typeSeen[type], expTypes[type],
`Expecting type '${type}' in graph`);
`Type '${type}': expecting: ${expTypes[type]} ` +
`found ${typeSeen[type]}`);
}
};

Expand Down

0 comments on commit a244b6f

Please sign in to comment.