Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: test-async-wrap-constructor refactor-for-to-foreach #32631

Closed
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions test/parallel/test-async-wrap-constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ require('../common');
const assert = require('assert');
const async_hooks = require('async_hooks');

for (const badArg of [0, 1, false, true, null, 'hello']) {
[0, 1, false, true, null, 'hello'].forEach((badArg) => {
const hookNames = ['init', 'before', 'after', 'destroy', 'promiseResolve'];
for (const field of hookNames) {
hookNames.forEach((field) => {
assert.throws(() => {
async_hooks.createHook({ [field]: badArg });
}, {
code: 'ERR_ASYNC_CALLBACK',
name: 'TypeError',
dericop marked this conversation as resolved.
Show resolved Hide resolved
});
dericop marked this conversation as resolved.
Show resolved Hide resolved
}
}
});
});