mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 00:20:08 +01:00
test: add trailing commas in test/node-api
PR-URL: https://github.com/nodejs/node/pull/46384 Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
ac66a99cf1
commit
d640feee85
|
|
@ -79,7 +79,6 @@ overrides:
|
|||
- internet/*.js
|
||||
- js-native-api/*/*.js
|
||||
- known_issues/*.js
|
||||
- node-api/*/*.js
|
||||
- parallel/*.js
|
||||
- parallel/*.mjs
|
||||
- pummel/*.js
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ async_hooks.createHook({
|
|||
if (testId === id) {
|
||||
events.push({ type: 'destroy', id });
|
||||
}
|
||||
}
|
||||
},
|
||||
}).enable();
|
||||
|
||||
const resource = { foo: 'foo' };
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ const test_hook = async_hooks.createHook({
|
|||
test_hook.enable();
|
||||
const asyncResource = createAsyncResource(
|
||||
{ foo: 'bar' },
|
||||
/* destroy_on_finalizer */false
|
||||
/* destroy_on_finalizer */false,
|
||||
);
|
||||
|
||||
// Trigger GC. This does *not* use global.gc(), because what we want to verify
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ const resourceWrap = createAsyncResource(
|
|||
/**
|
||||
* set resource to NULL to generate a managed resource object
|
||||
*/
|
||||
undefined
|
||||
undefined,
|
||||
);
|
||||
|
||||
assert.strictEqual(hook_result.destroy_called, false);
|
||||
|
|
@ -44,7 +44,7 @@ makeCallback(resourceWrap, recv, function callback() {
|
|||
assert.strictEqual(hook_result.destroy_called, false);
|
||||
assert.strictEqual(
|
||||
hook_result.resource,
|
||||
async_hooks.executionAsyncResource()
|
||||
async_hooks.executionAsyncResource(),
|
||||
);
|
||||
assert.strictEqual(this, recv);
|
||||
|
||||
|
|
@ -52,7 +52,7 @@ makeCallback(resourceWrap, recv, function callback() {
|
|||
assert.strictEqual(hook_result.destroy_called, false);
|
||||
assert.notStrictEqual(
|
||||
hook_result.resource,
|
||||
async_hooks.executionAsyncResource()
|
||||
async_hooks.executionAsyncResource(),
|
||||
);
|
||||
|
||||
destroyAsyncResource(resourceWrap);
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ async_hooks.createHook({
|
|||
after: common.mustCall((id) => {
|
||||
assert.strictEqual(id, expectedId);
|
||||
insideHook = false;
|
||||
})
|
||||
}),
|
||||
}).enable();
|
||||
|
||||
runInCallbackScope(expectedResource, expectedResourceType, () => {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ tmpdir.refresh();
|
|||
fs.rmSync(urlTestDir, {
|
||||
force: true,
|
||||
recursive: true,
|
||||
maxRetries: 256
|
||||
maxRetries: 256,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -57,9 +57,9 @@ function test(shouldFail, resources) {
|
|||
|
||||
test(false, [{
|
||||
url: depURL,
|
||||
integrity: `sha256-${hash('sha256', depBody)}`
|
||||
integrity: `sha256-${hash('sha256', depBody)}`,
|
||||
}]);
|
||||
test(true, [{
|
||||
url: depURL,
|
||||
integrity: `sha256akjsalkjdlaskjdk-${hash('sha256', depBody)}`
|
||||
integrity: `sha256akjsalkjdlaskjdk-${hash('sha256', depBody)}`,
|
||||
}]);
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ function testUnref(queueSize) {
|
|||
return new Promise((resolve, reject) => {
|
||||
let output = '';
|
||||
const child = fork(__filename, ['child', queueSize], {
|
||||
stdio: [process.stdin, 'pipe', process.stderr, 'ipc']
|
||||
stdio: [process.stdin, 'pipe', process.stderr, 'ipc'],
|
||||
});
|
||||
child.on('close', (code) => {
|
||||
if (code === 0) {
|
||||
|
|
@ -99,7 +99,7 @@ new Promise(function testWithoutJSMarshaller(resolve) {
|
|||
.then(() => testWithJSMarshaller({
|
||||
threadStarter: 'StartThread',
|
||||
maxQueueSize: binding.MAX_QUEUE_SIZE,
|
||||
quitAfter: binding.ARRAY_LENGTH
|
||||
quitAfter: binding.ARRAY_LENGTH,
|
||||
}))
|
||||
.then((result) => assert.deepStrictEqual(result, expectedArray))
|
||||
|
||||
|
|
@ -110,7 +110,7 @@ new Promise(function testWithoutJSMarshaller(resolve) {
|
|||
.then(() => testWithJSMarshaller({
|
||||
threadStarter: 'StartThreadNoJsFunc',
|
||||
maxQueueSize: binding.MAX_QUEUE_SIZE,
|
||||
quitAfter: binding.ARRAY_LENGTH
|
||||
quitAfter: binding.ARRAY_LENGTH,
|
||||
}))
|
||||
.then((result) => assert.deepStrictEqual(result, expectedArray))
|
||||
|
||||
|
|
@ -119,7 +119,7 @@ new Promise(function testWithoutJSMarshaller(resolve) {
|
|||
.then(() => testWithJSMarshaller({
|
||||
threadStarter: 'StartThread',
|
||||
maxQueueSize: 0,
|
||||
quitAfter: binding.ARRAY_LENGTH
|
||||
quitAfter: binding.ARRAY_LENGTH,
|
||||
}))
|
||||
.then((result) => assert.deepStrictEqual(result, expectedArray))
|
||||
|
||||
|
|
@ -128,7 +128,7 @@ new Promise(function testWithoutJSMarshaller(resolve) {
|
|||
.then(() => testWithJSMarshaller({
|
||||
threadStarter: 'StartThreadNonblocking',
|
||||
maxQueueSize: binding.MAX_QUEUE_SIZE,
|
||||
quitAfter: binding.ARRAY_LENGTH
|
||||
quitAfter: binding.ARRAY_LENGTH,
|
||||
}))
|
||||
.then((result) => assert.deepStrictEqual(result, expectedArray))
|
||||
|
||||
|
|
@ -137,7 +137,7 @@ new Promise(function testWithoutJSMarshaller(resolve) {
|
|||
.then(() => testWithJSMarshaller({
|
||||
threadStarter: 'StartThread',
|
||||
maxQueueSize: binding.MAX_QUEUE_SIZE,
|
||||
quitAfter: 1
|
||||
quitAfter: 1,
|
||||
}))
|
||||
.then((result) => assert.deepStrictEqual(result, expectedArray))
|
||||
|
||||
|
|
@ -146,7 +146,7 @@ new Promise(function testWithoutJSMarshaller(resolve) {
|
|||
.then(() => testWithJSMarshaller({
|
||||
threadStarter: 'StartThread',
|
||||
maxQueueSize: 0,
|
||||
quitAfter: 1
|
||||
quitAfter: 1,
|
||||
}))
|
||||
.then((result) => assert.deepStrictEqual(result, expectedArray))
|
||||
|
||||
|
|
@ -155,7 +155,7 @@ new Promise(function testWithoutJSMarshaller(resolve) {
|
|||
.then(() => testWithJSMarshaller({
|
||||
threadStarter: 'StartThreadNonblocking',
|
||||
maxQueueSize: binding.MAX_QUEUE_SIZE,
|
||||
quitAfter: 1
|
||||
quitAfter: 1,
|
||||
}))
|
||||
.then((result) => assert.deepStrictEqual(result, expectedArray))
|
||||
|
||||
|
|
@ -166,7 +166,7 @@ new Promise(function testWithoutJSMarshaller(resolve) {
|
|||
threadStarter: 'StartThread',
|
||||
quitAfter: 1,
|
||||
maxQueueSize: binding.MAX_QUEUE_SIZE,
|
||||
launchSecondary: true
|
||||
launchSecondary: true,
|
||||
}))
|
||||
.then((result) => assert.deepStrictEqual(result, expectedArray))
|
||||
|
||||
|
|
@ -177,7 +177,7 @@ new Promise(function testWithoutJSMarshaller(resolve) {
|
|||
threadStarter: 'StartThreadNonblocking',
|
||||
quitAfter: 1,
|
||||
maxQueueSize: binding.MAX_QUEUE_SIZE,
|
||||
launchSecondary: true
|
||||
launchSecondary: true,
|
||||
}))
|
||||
.then((result) => assert.deepStrictEqual(result, expectedArray))
|
||||
|
||||
|
|
@ -187,7 +187,7 @@ new Promise(function testWithoutJSMarshaller(resolve) {
|
|||
threadStarter: 'StartThread',
|
||||
quitAfter: 1,
|
||||
maxQueueSize: binding.MAX_QUEUE_SIZE,
|
||||
abort: true
|
||||
abort: true,
|
||||
}))
|
||||
.then((result) => assert.strictEqual(result.indexOf(0), -1))
|
||||
|
||||
|
|
@ -197,7 +197,7 @@ new Promise(function testWithoutJSMarshaller(resolve) {
|
|||
threadStarter: 'StartThread',
|
||||
quitAfter: 1,
|
||||
maxQueueSize: 0,
|
||||
abort: true
|
||||
abort: true,
|
||||
}))
|
||||
.then((result) => assert.strictEqual(result.indexOf(0), -1))
|
||||
|
||||
|
|
@ -207,7 +207,7 @@ new Promise(function testWithoutJSMarshaller(resolve) {
|
|||
threadStarter: 'StartThreadNonblocking',
|
||||
quitAfter: 1,
|
||||
maxQueueSize: binding.MAX_QUEUE_SIZE,
|
||||
abort: true
|
||||
abort: true,
|
||||
}))
|
||||
.then((result) => assert.strictEqual(result.indexOf(0), -1))
|
||||
|
||||
|
|
@ -216,7 +216,7 @@ new Promise(function testWithoutJSMarshaller(resolve) {
|
|||
.then(() => testWithJSMarshaller({
|
||||
threadStarter: 'StartThreadNonblocking',
|
||||
maxQueueSize: binding.ARRAY_LENGTH >>> 1,
|
||||
quitAfter: binding.ARRAY_LENGTH
|
||||
quitAfter: binding.ARRAY_LENGTH,
|
||||
}))
|
||||
.then((result) => assert.deepStrictEqual(result, expectedArray))
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ const binding = require(`./build/${common.buildType}/binding`);
|
|||
process.on(
|
||||
'uncaughtException',
|
||||
common.mustNotCall('uncaught callback errors should be suppressed ' +
|
||||
'with the option --no-force-node-api-uncaught-exceptions-policy')
|
||||
'with the option --no-force-node-api-uncaught-exceptions-policy'),
|
||||
);
|
||||
|
||||
binding.CallIntoModule(
|
||||
|
|
@ -18,5 +18,5 @@ binding.CallIntoModule(
|
|||
'resource_name',
|
||||
common.mustCall(function finalizer() {
|
||||
throw new Error('finalizer error');
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -23,5 +23,5 @@ binding.CallIntoModule(
|
|||
'resource_name',
|
||||
common.mustCall(function finalizer() {
|
||||
throw new Error('finalizer error');
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user