Skip to content

Commit d5b0844

Browse files
aduh95danielleadams
authored andcommitted
test: add trailing commas in addons test (#45548)
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>
1 parent b1e17b4 commit d5b0844

17 files changed

+27
-28
lines changed

test/.eslintrc.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ globals:
7272

7373
overrides:
7474
- files:
75-
- addons/*/*.js
7675
- async-hooks/*.js
7776
- es-module/*.js
7877
- es-module/*.mjs

test/addons/async-hooks-id/test.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ const async_hooks = require('async_hooks');
77

88
assert.strictEqual(
99
binding.getExecutionAsyncId(),
10-
async_hooks.executionAsyncId()
10+
async_hooks.executionAsyncId(),
1111
);
1212
assert.strictEqual(
1313
binding.getTriggerAsyncId(),
14-
async_hooks.triggerAsyncId()
14+
async_hooks.triggerAsyncId(),
1515
);
1616

1717
process.nextTick(common.mustCall(() => {
1818
assert.strictEqual(
1919
binding.getExecutionAsyncId(),
20-
async_hooks.executionAsyncId()
20+
async_hooks.executionAsyncId(),
2121
);
2222
assert.strictEqual(
2323
binding.getTriggerAsyncId(),
24-
async_hooks.triggerAsyncId()
24+
async_hooks.triggerAsyncId(),
2525
);
2626
}));

test/addons/async-resource/test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ async_hooks.createHook({
3838

3939
destroy(id) {
4040
if (bindingUids.includes(id)) destroy++;
41-
}
41+
},
4242
}).enable();
4343

4444
for (const call of [binding.callViaFunction,
@@ -53,7 +53,7 @@ for (const call of [binding.callViaFunction,
5353
assert.strictEqual(async_hooks.executionAsyncId(), uid);
5454
return 'baz';
5555
},
56-
kObjectTag
56+
kObjectTag,
5757
};
5858

5959
if (passedTriggerId === undefined)

test/addons/callback-scope/test-async-hooks.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ async_hooks.createHook({
1414
after: common.mustCall((id) => {
1515
assert.strictEqual(id, 1000);
1616
insideHook = false;
17-
})
17+
}),
1818
}).enable();
1919

2020
runInCallbackScope({}, 1000, 1000, () => {

test/addons/no-addons/test-worker.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const assertError = (error) => {
1313
assert.strictEqual(error.code, 'ERR_DLOPEN_DISABLED');
1414
assert.strictEqual(
1515
error.message,
16-
'Cannot load native addon because loading addons is disabled.'
16+
'Cannot load native addon because loading addons is disabled.',
1717
);
1818
};
1919

@@ -32,7 +32,7 @@ const assertError = (error) => {
3232
`process.dlopen({ exports: {} }, ${JSON.stringify(binding)});`,
3333
{
3434
eval: true,
35-
}
35+
},
3636
);
3737

3838
worker.on('error', common.mustCall(assertError));

test/addons/no-addons/test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const assertError = (error) => {
1212
assert.strictEqual(error.code, 'ERR_DLOPEN_DISABLED');
1313
assert.strictEqual(
1414
error.message,
15-
'Cannot load native addon because loading addons is disabled.'
15+
'Cannot load native addon because loading addons is disabled.',
1616
);
1717
};
1818

test/addons/non-node-context/test-make-buffer.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const common = require('../../common');
44
const assert = require('assert');
55
const {
6-
makeBufferInNewContext
6+
makeBufferInNewContext,
77
} = require(`./build/${common.buildType}/binding`);
88

99
// Because the `Buffer` function and its protoype property only (currently)
@@ -19,5 +19,5 @@ assert.throws(
1919
assert.strictEqual(exception.message,
2020
'Buffer is not available for the current Context');
2121
return true;
22-
}
22+
},
2323
);

test/addons/openssl-client-cert-engine/test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const serverOptions = {
2626
cert: agentCert,
2727
ca: agentCa,
2828
requestCert: true,
29-
rejectUnauthorized: true
29+
rejectUnauthorized: true,
3030
};
3131

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

4646
const req = https.request(clientOptions, common.mustCall((response) => {

test/addons/openssl-key-engine/test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const serverOptions = {
2626
cert: agentCert,
2727
ca: agentCa,
2828
requestCert: true,
29-
rejectUnauthorized: true
29+
rejectUnauthorized: true,
3030
};
3131

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

4848
const req = https.request(clientOptions, common.mustCall((response) => {

test/addons/repl-domain-abort/test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const options = {
6363
input: dInput,
6464
output: dOutput,
6565
terminal: false,
66-
ignoreUndefined: true
66+
ignoreUndefined: true,
6767
};
6868

6969
// Run commands from fake REPL.

test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-ascii.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ assert.throws(() => {
3232
message: `Cannot create a string longer than 0x${stringLengthHex} ` +
3333
'characters',
3434
code: 'ERR_STRING_TOO_LONG',
35-
name: 'Error'
35+
name: 'Error',
3636
});

test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-base64.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ assert.throws(() => {
3232
message: `Cannot create a string longer than 0x${stringLengthHex} ` +
3333
'characters',
3434
code: 'ERR_STRING_TOO_LONG',
35-
name: 'Error'
35+
name: 'Error',
3636
});

test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-binary.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ assert.throws(() => {
3333
message: `Cannot create a string longer than 0x${stringLengthHex} ` +
3434
'characters',
3535
code: 'ERR_STRING_TOO_LONG',
36-
name: 'Error'
36+
name: 'Error',
3737
});
3838

3939
// FIXME: Free the memory early to avoid OOM.

test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-hex.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ assert.throws(() => {
3232
message: `Cannot create a string longer than 0x${stringLengthHex} ` +
3333
'characters',
3434
code: 'ERR_STRING_TOO_LONG',
35-
name: 'Error'
35+
name: 'Error',
3636
});

test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-utf8.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ assert.throws(() => {
3535
message: `Cannot create a string longer than 0x${stringLengthHex} ` +
3636
'characters',
3737
code: 'ERR_STRING_TOO_LONG',
38-
name: 'Error'
38+
name: 'Error',
3939
})(e);
4040
return true;
4141
}
@@ -48,5 +48,5 @@ assert.throws(() => {
4848
message: `Cannot create a string longer than 0x${stringLengthHex} ` +
4949
'characters',
5050
code: 'ERR_STRING_TOO_LONG',
51-
name: 'Error'
51+
name: 'Error',
5252
});

test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ assert.throws(() => {
3333
message: `Cannot create a string longer than 0x${stringLengthHex} ` +
3434
'characters',
3535
code: 'ERR_STRING_TOO_LONG',
36-
name: 'Error'
36+
name: 'Error',
3737
});

test/addons/worker-addon/test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ switch (process.argv[2]) {
1313
case 'worker-twice':
1414
case 'worker': {
1515
const worker = new Worker(`require(${JSON.stringify(binding)});`, {
16-
eval: true
16+
eval: true,
1717
});
1818
if (process.argv[2] === 'worker-twice') {
1919
worker.on('exit', common.mustCall(() => {
2020
new Worker(`require(${JSON.stringify(binding)});`, {
21-
eval: true
21+
eval: true,
2222
});
2323
}));
2424
}
@@ -52,7 +52,7 @@ for (const { test, expected } of [
5252
'ctor cleanup dtor ctor cleanup dtor ',
5353
].concat(libcMayBeMusl ? [
5454
'ctor cleanup cleanup dtor ',
55-
] : [])
55+
] : []),
5656
},
5757
]) {
5858
console.log('spawning test', test);

0 commit comments

Comments
 (0)