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:
Rich Trott 2018-05-24 13:54:21 -07:00 committed by Ruben Bridgewater
parent cfc9d0468c
commit f315081dc7
No known key found for this signature in database
GPG Key ID: F07496B3EB3C1762

View File

@ -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);