Skip to content

Commit

Permalink
test: improve error message in async-wrap test
Browse files Browse the repository at this point in the history
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: #20948
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
Trott authored and MylesBorins committed May 29, 2018
1 parent 460add9 commit d09bec8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/parallel/test-async-wrap-pop-id-during-load.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

0 comments on commit d09bec8

Please sign in to comment.