mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 21:58:48 +02:00
test: add trailing commas in async-hooks tests (#45549)
PR-URL: https://github.com/nodejs/node/pull/45549 Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
This commit is contained in:
parent
4f20c882ec
commit
cf46746b8a
49 changed files with 78 additions and 79 deletions
|
@ -9,14 +9,14 @@ const arg = process.argv[2];
|
|||
switch (arg) {
|
||||
case 'test_init_callback':
|
||||
initHooks({
|
||||
oninit: common.mustCall(() => { throw new Error(arg); })
|
||||
oninit: common.mustCall(() => { throw new Error(arg); }),
|
||||
}).enable();
|
||||
new async_hooks.AsyncResource(`${arg}_type`);
|
||||
return;
|
||||
|
||||
case 'test_callback': {
|
||||
initHooks({
|
||||
onbefore: common.mustCall(() => { throw new Error(arg); })
|
||||
onbefore: common.mustCall(() => { throw new Error(arg); }),
|
||||
}).enable();
|
||||
const resource = new async_hooks.AsyncResource(`${arg}_type`);
|
||||
resource.runInAsyncScope(() => {});
|
||||
|
@ -25,7 +25,7 @@ switch (arg) {
|
|||
|
||||
case 'test_callback_abort':
|
||||
initHooks({
|
||||
oninit: common.mustCall(() => { throw new Error(arg); })
|
||||
oninit: common.mustCall(() => { throw new Error(arg); }),
|
||||
}).enable();
|
||||
new async_hooks.AsyncResource(`${arg}_type`);
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue