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: add missing trailing commas in addons test #45548

Merged
merged 1 commit into from Nov 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion test/.eslintrc.yaml
Expand Up @@ -72,7 +72,6 @@ globals:

overrides:
- files:
- addons/*/*.js
- async-hooks/*.js
- common/*.js
- es-module/*.js
Expand Down
8 changes: 4 additions & 4 deletions test/addons/async-hooks-id/test.js
Expand Up @@ -7,20 +7,20 @@ const async_hooks = require('async_hooks');

assert.strictEqual(
binding.getExecutionAsyncId(),
async_hooks.executionAsyncId()
async_hooks.executionAsyncId(),
);
assert.strictEqual(
binding.getTriggerAsyncId(),
async_hooks.triggerAsyncId()
async_hooks.triggerAsyncId(),
);

process.nextTick(common.mustCall(() => {
assert.strictEqual(
binding.getExecutionAsyncId(),
async_hooks.executionAsyncId()
async_hooks.executionAsyncId(),
);
assert.strictEqual(
binding.getTriggerAsyncId(),
async_hooks.triggerAsyncId()
async_hooks.triggerAsyncId(),
);
}));
4 changes: 2 additions & 2 deletions test/addons/async-resource/test.js
Expand Up @@ -38,7 +38,7 @@ async_hooks.createHook({

destroy(id) {
if (bindingUids.includes(id)) destroy++;
}
},
}).enable();

for (const call of [binding.callViaFunction,
Expand All @@ -53,7 +53,7 @@ for (const call of [binding.callViaFunction,
assert.strictEqual(async_hooks.executionAsyncId(), uid);
return 'baz';
},
kObjectTag
kObjectTag,
};

if (passedTriggerId === undefined)
Expand Down
2 changes: 1 addition & 1 deletion test/addons/callback-scope/test-async-hooks.js
Expand Up @@ -14,7 +14,7 @@ async_hooks.createHook({
after: common.mustCall((id) => {
assert.strictEqual(id, 1000);
insideHook = false;
})
}),
}).enable();

runInCallbackScope({}, 1000, 1000, () => {
Expand Down
4 changes: 2 additions & 2 deletions test/addons/no-addons/test-worker.js
Expand Up @@ -13,7 +13,7 @@ const assertError = (error) => {
assert.strictEqual(error.code, 'ERR_DLOPEN_DISABLED');
assert.strictEqual(
error.message,
'Cannot load native addon because loading addons is disabled.'
'Cannot load native addon because loading addons is disabled.',
);
};

Expand All @@ -32,7 +32,7 @@ const assertError = (error) => {
`process.dlopen({ exports: {} }, ${JSON.stringify(binding)});`,
{
eval: true,
}
},
);

worker.on('error', common.mustCall(assertError));
Expand Down
2 changes: 1 addition & 1 deletion test/addons/no-addons/test.js
Expand Up @@ -12,7 +12,7 @@ const assertError = (error) => {
assert.strictEqual(error.code, 'ERR_DLOPEN_DISABLED');
assert.strictEqual(
error.message,
'Cannot load native addon because loading addons is disabled.'
'Cannot load native addon because loading addons is disabled.',
);
};

Expand Down
4 changes: 2 additions & 2 deletions test/addons/non-node-context/test-make-buffer.js
Expand Up @@ -3,7 +3,7 @@
const common = require('../../common');
const assert = require('assert');
const {
makeBufferInNewContext
makeBufferInNewContext,
} = require(`./build/${common.buildType}/binding`);

// Because the `Buffer` function and its protoype property only (currently)
Expand All @@ -19,5 +19,5 @@ assert.throws(
assert.strictEqual(exception.message,
'Buffer is not available for the current Context');
return true;
}
},
);
4 changes: 2 additions & 2 deletions test/addons/openssl-client-cert-engine/test.js
Expand Up @@ -26,7 +26,7 @@ const serverOptions = {
cert: agentCert,
ca: agentCa,
requestCert: true,
rejectUnauthorized: true
rejectUnauthorized: true,
};

const server = https.createServer(serverOptions, common.mustCall((req, res) => {
Expand All @@ -40,7 +40,7 @@ const server = https.createServer(serverOptions, common.mustCall((req, res) => {
path: '/test',
clientCertEngine: engine, // `engine` will provide key+cert
rejectUnauthorized: false, // Prevent failing on self-signed certificates
headers: {}
headers: {},
};

const req = https.request(clientOptions, common.mustCall((response) => {
Expand Down
4 changes: 2 additions & 2 deletions test/addons/openssl-key-engine/test.js
Expand Up @@ -26,7 +26,7 @@ const serverOptions = {
cert: agentCert,
ca: agentCa,
requestCert: true,
rejectUnauthorized: true
rejectUnauthorized: true,
};

const server = https.createServer(serverOptions, common.mustCall((req, res) => {
Expand All @@ -42,7 +42,7 @@ const server = https.createServer(serverOptions, common.mustCall((req, res) => {
privateKeyIdentifier: 'dummykey',
cert: agentCert,
rejectUnauthorized: false, // Prevent failing on self-signed certificates
headers: {}
headers: {},
};

const req = https.request(clientOptions, common.mustCall((response) => {
Expand Down
2 changes: 1 addition & 1 deletion test/addons/repl-domain-abort/test.js
Expand Up @@ -63,7 +63,7 @@ const options = {
input: dInput,
output: dOutput,
terminal: false,
ignoreUndefined: true
ignoreUndefined: true,
};

// Run commands from fake REPL.
Expand Down
Expand Up @@ -32,5 +32,5 @@ assert.throws(() => {
message: `Cannot create a string longer than 0x${stringLengthHex} ` +
'characters',
code: 'ERR_STRING_TOO_LONG',
name: 'Error'
name: 'Error',
});
Expand Up @@ -32,5 +32,5 @@ assert.throws(() => {
message: `Cannot create a string longer than 0x${stringLengthHex} ` +
'characters',
code: 'ERR_STRING_TOO_LONG',
name: 'Error'
name: 'Error',
});
Expand Up @@ -33,7 +33,7 @@ assert.throws(() => {
message: `Cannot create a string longer than 0x${stringLengthHex} ` +
'characters',
code: 'ERR_STRING_TOO_LONG',
name: 'Error'
name: 'Error',
});

// FIXME: Free the memory early to avoid OOM.
Expand Down
Expand Up @@ -32,5 +32,5 @@ assert.throws(() => {
message: `Cannot create a string longer than 0x${stringLengthHex} ` +
'characters',
code: 'ERR_STRING_TOO_LONG',
name: 'Error'
name: 'Error',
});
Expand Up @@ -35,7 +35,7 @@ assert.throws(() => {
message: `Cannot create a string longer than 0x${stringLengthHex} ` +
'characters',
code: 'ERR_STRING_TOO_LONG',
name: 'Error'
name: 'Error',
})(e);
return true;
}
Expand All @@ -48,5 +48,5 @@ assert.throws(() => {
message: `Cannot create a string longer than 0x${stringLengthHex} ` +
'characters',
code: 'ERR_STRING_TOO_LONG',
name: 'Error'
name: 'Error',
});
Expand Up @@ -33,5 +33,5 @@ assert.throws(() => {
message: `Cannot create a string longer than 0x${stringLengthHex} ` +
'characters',
code: 'ERR_STRING_TOO_LONG',
name: 'Error'
name: 'Error',
});
6 changes: 3 additions & 3 deletions test/addons/worker-addon/test.js
Expand Up @@ -13,12 +13,12 @@ switch (process.argv[2]) {
case 'worker-twice':
case 'worker': {
const worker = new Worker(`require(${JSON.stringify(binding)});`, {
eval: true
eval: true,
});
if (process.argv[2] === 'worker-twice') {
worker.on('exit', common.mustCall(() => {
new Worker(`require(${JSON.stringify(binding)});`, {
eval: true
eval: true,
});
}));
}
Expand Down Expand Up @@ -52,7 +52,7 @@ for (const { test, expected } of [
'ctor cleanup dtor ctor cleanup dtor ',
].concat(libcMayBeMusl ? [
'ctor cleanup cleanup dtor ',
] : [])
] : []),
},
]) {
console.log('spawning test', test);
Expand Down