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:
Ali Ijaz Sheikh 2019-05-07 14:35:17 -07:00 committed by Anto Aravinth
parent f60afa6269
commit a244b6f591

View File

@ -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]}`);
} }
}; };