Skip to content

Commit 29f7c4d

Browse files
dericopBethGriggs
authored andcommitted
test: test-async-wrap-constructor prefer forEach
PR-URL: #32631 Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent 919d924 commit 29f7c4d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/parallel/test-async-wrap-constructor.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ require('../common');
66
const assert = require('assert');
77
const async_hooks = require('async_hooks');
88

9-
for (const badArg of [0, 1, false, true, null, 'hello']) {
9+
[0, 1, false, true, null, 'hello'].forEach((badArg) => {
1010
const hookNames = ['init', 'before', 'after', 'destroy', 'promiseResolve'];
11-
for (const field of hookNames) {
11+
hookNames.forEach((field) => {
1212
assert.throws(() => {
1313
async_hooks.createHook({ [field]: badArg });
1414
}, {
1515
code: 'ERR_ASYNC_CALLBACK',
1616
name: 'TypeError',
17+
message: `hook.${field} must be a function`
1718
});
18-
}
19-
}
19+
});
20+
});

0 commit comments

Comments
 (0)