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: https://github.com/nodejs/node/pull/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>
This commit is contained in:
parent
f60afa6269
commit
a244b6f591
@ -108,7 +108,8 @@ module.exports = function verifyGraph(hooks, graph) {
|
|||||||
|
|
||||||
for (const type in expTypes) {
|
for (const type in expTypes) {
|
||||||
assert.strictEqual(typeSeen[type], expTypes[type],
|
assert.strictEqual(typeSeen[type], expTypes[type],
|
||||||
`Expecting type '${type}' in graph`);
|
`Type '${type}': expecting: ${expTypes[type]} ` +
|
||||||
|
`found ${typeSeen[type]}`);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user