Skip to content

Commit 8cba1af

Browse files
ofrobotstargos
authored andcommitted
test: better assertion for async hook tests
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 <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 8d448be commit 8cba1af

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/async-hooks/verify-graph.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ module.exports = function verifyGraph(hooks, graph) {
108108

109109
for (const type in expTypes) {
110110
assert.strictEqual(typeSeen[type], expTypes[type],
111-
`Expecting type '${type}' in graph`);
111+
`Type '${type}': expecting: ${expTypes[type]} ` +
112+
`found ${typeSeen[type]}`);
112113
}
113114
};
114115

0 commit comments

Comments
 (0)