From 8cba1affe3535eedd388e48cda632976b2fb848c Mon Sep 17 00:00:00 2001 From: Ali Ijaz Sheikh Date: Tue, 7 May 2019 14:35:17 -0700 Subject: [PATCH] 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 Reviewed-By: Ruben Bridgewater Reviewed-By: Colin Ihrig Reviewed-By: Trivikram Kamat Reviewed-By: James M Snell --- test/async-hooks/verify-graph.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/async-hooks/verify-graph.js b/test/async-hooks/verify-graph.js index 1b188faa149b21..99b32e908165cd 100644 --- a/test/async-hooks/verify-graph.js +++ b/test/async-hooks/verify-graph.js @@ -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]}`); } };