test: fixing broken test

test didn't throw the error, it was just returning it. So I removed
the try/catch and assigned the error to a variable

PR-URL: https://github.com/nodejs/node/pull/28345
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
melinamejia95 2019-06-21 16:20:39 -05:00 committed by ZYSzys
parent 945134361f
commit fad3b64350

View File

@ -117,12 +117,10 @@ async function destroysTheStreamWhenThrowing() {
stream.read(); stream.read();
try { const [err] = await once(stream, 'error');
await once(stream, 'error');
} catch (err) {
strictEqual(err.message, 'kaboom'); strictEqual(err.message, 'kaboom');
strictEqual(stream.destroyed, true); strictEqual(stream.destroyed, true);
}
} }
async function asTransformStream() { async function asTransformStream() {