From d09bec8a047b99d1b7428431d6f5de9be20ba8ee Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 24 May 2018 13:54:21 -0700 Subject: [PATCH] test: improve error message in async-wrap test Improve AssertionError message in test/parallel/test-async-wrap-pop-id-during-load.js to include the contents of stderr when the spawned process fails. Refs: https://github.com/nodejs/node/pull/20940/files#r190707951 PR-URL: https://github.com/nodejs/node/pull/20948 Reviewed-By: Richard Lau Reviewed-By: Trivikram Kamat Reviewed-By: Luigi Pinca Reviewed-By: Ruben Bridgewater Reviewed-By: James M Snell --- test/parallel/test-async-wrap-pop-id-during-load.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-async-wrap-pop-id-during-load.js b/test/parallel/test-async-wrap-pop-id-during-load.js index 4cf1ef472b6037..d9fffd397f6003 100644 --- a/test/parallel/test-async-wrap-pop-id-during-load.js +++ b/test/parallel/test-async-wrap-pop-id-during-load.js @@ -17,7 +17,8 @@ const ret = spawnSync( process.execPath, ['--stack_size=50', __filename, 'async'] ); -assert.strictEqual(ret.status, 0); +assert.strictEqual(ret.status, 0, + `EXIT CODE: ${ret.status}, STDERR:\n${ret.stderr}`); const stderr = ret.stderr.toString('utf8', 0, 2048); assert.ok(!/async.*hook/i.test(stderr)); assert.ok(stderr.includes('UnhandledPromiseRejectionWarning: Error'), stderr);