Skip to content

Commit b4ef062

Browse files
dericopBethGriggs
authored andcommitted
test: test-async-wrap-constructor prefer forEach
PR-URL: #32631 Reviewed-By: Juan José Arboleda <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent 1a2b3eb commit b4ef062

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ require('../common');
66
constassert=require('assert');
77
constasync_hooks=require('async_hooks');
88

9-
for(constbadArgof[0,1,false,true,null,'hello']){
9+
[0,1,false,true,null,'hello'].forEach((badArg)=>{
1010
consthookNames=['init','before','after','destroy','promiseResolve'];
11-
for(constfieldofhookNames){
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)