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 <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>
This commit is contained in:
parent
cfc9d0468c
commit
f315081dc7
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user