diff options
author | Braden Whitten <bwhitten518@gmail.com> | 2017-10-07 02:14:31 +0300 |
---|---|---|
committer | Myles Borins <mylesborins@google.com> | 2017-10-24 00:18:12 +0300 |
commit | 2e2c09e5de139fe2eb73c8ad229cef98a82c48c9 (patch) | |
tree | c2be785275e8756d8932016a78d97bcff9da83e6 /test | |
parent | 6f5edf4894bd4c6349cba6d650a0ced53c236e68 (diff) |
test: more AsyncWrap constructor validation tests
Fixes a line of uncovered code in the AsyncWrap class's constructor.
Specifically this covers validtion of the 'promiseResolve' argument.
PR-URL: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-async-wrap-constructor.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/parallel/test-async-wrap-constructor.js b/test/parallel/test-async-wrap-constructor.js index 86fce0e3f39..5fdf9e4fdf8 100644 --- a/test/parallel/test-async-wrap-constructor.js +++ b/test/parallel/test-async-wrap-constructor.js @@ -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({ |