Skip to content

Commit

Permalink
test: add trailing commas in addons test (#45548)
Browse files Browse the repository at this point in the history
PR-URL: #45548
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>
  • Loading branch information
aduh95 authored and danielleadams committed Jan 4, 2023
1 parent 19b0e5f commit 77215f6
Show file tree
Hide file tree
Showing 17 changed files with 27 additions and 28 deletions.
1 change: 0 additions & 1 deletion test/.eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ globals:

overrides:
- files:
- addons/*/*.js
- async-hooks/*.js
- es-module/*.js
- es-module/*.mjs
Expand Down
8 changes: 4 additions & 4 deletions test/addons/async-hooks-id/test.js
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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',
});
Original file line number Diff line number Diff line change
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',
});
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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',
});
Original file line number Diff line number Diff line change
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',
});
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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

0 comments on commit 77215f6

Please sign in to comment.