From ba999e1b9e96370e074f4227fd59db52d7554a54 Mon Sep 17 00:00:00 2001 From: Braden Whitten Date: Fri, 6 Oct 2017 16:14:31 -0700 Subject: [PATCH] test: more AsyncWrap constructor validation tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: Colin Ihrig Reviewed-By: Benjamin Gruenbaum Reviewed-By: Tobias Nießen Reviewed-By: James M Snell Reviewed-By: Refael Ackermann Reviewed-By: Luigi Pinca Reviewed-By: Yuta Hiroto --- test/parallel/test-async-wrap-constructor.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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({