Skip to content

Commit

Permalink
test: more AsyncWrap constructor validation tests
Browse files Browse the repository at this point in the history
Fixes a line of uncovered code in the AsyncWrap class's constructor.
Specifically this covers validtion of the 'promiseResolve' argument.

PR-URL: #16025
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
  • Loading branch information
bwhitty authored and MylesBorins committed Oct 23, 2017
1 parent 6f5edf4 commit 2e2c09e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/parallel/test-async-wrap-constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ const assert = require('assert');
const async_hooks = require('async_hooks');

for (const badArg of [0, 1, false, true, null, 'hello']) {
for (const field of ['init', 'before', 'after', 'destroy']) {
const hookNames = ['init', 'before', 'after', 'destroy', 'promiseResolve'];
for (const field of hookNames) {
assert.throws(() => {
async_hooks.createHook({ [field]: badArg });
}, common.expectsError({
Expand Down

0 comments on commit 2e2c09e

Please sign in to comment.