We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1a2b3eb commit b4ef062Copy full SHA for b4ef062
1 file changed
test/parallel/test-async-wrap-constructor.js
@@ -6,14 +6,15 @@ require('../common');
6
const assert = require('assert');
7
const async_hooks = require('async_hooks');
8
9
-for (const badArg of [0, 1, false, true, null, 'hello']) {
+[0, 1, false, true, null, 'hello'].forEach((badArg) => {
10
const hookNames = ['init', 'before', 'after', 'destroy', 'promiseResolve'];
11
- for (const field of hookNames) {
+ hookNames.forEach((field) => {
12
assert.throws(() => {
13
async_hooks.createHook({ [field]: badArg });
14
}, {
15
code: 'ERR_ASYNC_CALLBACK',
16
name: 'TypeError',
17
+ message: `hook.${field} must be a function`
18
});
- }
19
-}
+ });
20
+});
0 commit comments