summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine du Hamel <duhamelantoine1995@gmail.com>2022-11-21 12:43:47 -0500
committerGitHub <noreply@github.com>2022-11-21 18:43:47 +0100
commitcf46746b8af4bd3fe9afc708e76ffd68f10b4785 (patch)
tree9244ec44f424855519c8618aa8cedb5793397481
parent4f20c882ec123b3155e9dc6a0e21fc81b39f04bb (diff)
downloadnode-new-cf46746b8af4bd3fe9afc708e76ffd68f10b4785.tar.gz
test: add trailing commas in async-hooks tests (#45549)
PR-URL: https://github.com/nodejs/node/pull/45549 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>
-rw-r--r--test/.eslintrc.yaml1
-rw-r--r--test/async-hooks/hook-checks.js2
-rw-r--r--test/async-hooks/init-hooks.js10
-rw-r--r--test/async-hooks/test-async-await.js2
-rw-r--r--test/async-hooks/test-async-exec-resource-http-32060.js2
-rw-r--r--test/async-hooks/test-async-exec-resource-http.js2
-rw-r--r--test/async-hooks/test-async-exec-resource-match.js4
-rw-r--r--test/async-hooks/test-async-local-storage-http-agent.js2
-rw-r--r--test/async-hooks/test-async-local-storage-stop-propagation.js6
-rw-r--r--test/async-hooks/test-async-local-storage-thenable.js2
-rw-r--r--test/async-hooks/test-async-local-storage-tlssocket.js2
-rw-r--r--test/async-hooks/test-callback-error.js6
-rw-r--r--test/async-hooks/test-destroy-not-blocked.js10
-rw-r--r--test/async-hooks/test-disable-in-init.js4
-rw-r--r--test/async-hooks/test-embedder.api.async-resource-no-type.js2
-rw-r--r--test/async-hooks/test-embedder.api.async-resource.js2
-rw-r--r--test/async-hooks/test-emit-after-on-destroyed.js2
-rw-r--r--test/async-hooks/test-emit-before-after.js2
-rw-r--r--test/async-hooks/test-emit-before-on-destroyed.js2
-rw-r--r--test/async-hooks/test-emit-init.js4
-rw-r--r--test/async-hooks/test-enable-in-init.js4
-rw-r--r--test/async-hooks/test-filehandle-no-reuse.js4
-rw-r--r--test/async-hooks/test-graph.fsreq-readFile.js2
-rw-r--r--test/async-hooks/test-graph.http.js4
-rw-r--r--test/async-hooks/test-graph.intervals.js2
-rw-r--r--test/async-hooks/test-graph.pipe.js2
-rw-r--r--test/async-hooks/test-graph.pipeconnect.js2
-rw-r--r--test/async-hooks/test-graph.shutdown.js2
-rw-r--r--test/async-hooks/test-graph.signal.js2
-rw-r--r--test/async-hooks/test-graph.statwatcher.js2
-rw-r--r--test/async-hooks/test-graph.tcp.js2
-rw-r--r--test/async-hooks/test-graph.timeouts.js2
-rw-r--r--test/async-hooks/test-graph.tls-write.js4
-rw-r--r--test/async-hooks/test-http-agent-handle-reuse-parallel.js6
-rw-r--r--test/async-hooks/test-http-agent-handle-reuse-serial.js8
-rw-r--r--test/async-hooks/test-httpparser-reuse.js4
-rw-r--r--test/async-hooks/test-httpparser.request.js2
-rw-r--r--test/async-hooks/test-httpparser.response.js2
-rw-r--r--test/async-hooks/test-improper-order.js2
-rw-r--r--test/async-hooks/test-improper-unwind.js2
-rw-r--r--test/async-hooks/test-late-hook-enable.js2
-rw-r--r--test/async-hooks/test-nexttick-default-trigger.js2
-rw-r--r--test/async-hooks/test-pipewrap.js2
-rw-r--r--test/async-hooks/test-queue-microtask.js2
-rw-r--r--test/async-hooks/test-tlswrap.js2
-rw-r--r--test/async-hooks/test-ttywrap.readstream.js2
-rw-r--r--test/async-hooks/test-unhandled-rejection-context.js2
-rw-r--r--test/async-hooks/test-zlib.zlib-binding.deflate.js4
-rw-r--r--test/async-hooks/verify-graph.js10
49 files changed, 78 insertions, 79 deletions
diff --git a/test/.eslintrc.yaml b/test/.eslintrc.yaml
index 1589547b52..b0a648738e 100644
--- a/test/.eslintrc.yaml
+++ b/test/.eslintrc.yaml
@@ -72,7 +72,6 @@ globals:
overrides:
- files:
- - async-hooks/*.js
- es-module/*.js
- es-module/*.mjs
- internet/*.js
diff --git a/test/async-hooks/hook-checks.js b/test/async-hooks/hook-checks.js
index e1328810f5..6ad79bc68e 100644
--- a/test/async-hooks/hook-checks.js
+++ b/test/async-hooks/hook-checks.js
@@ -21,7 +21,7 @@ exports.checkInvocations = function checkInvocations(activity, hooks, stage) {
assert.ok(activity != null,
`${stageInfo} Trying to check invocation for an activity, ` +
- 'but it was empty/undefined.'
+ 'but it was empty/undefined.',
);
// Check that actual invocations for all hooks match the expected invocations
diff --git a/test/async-hooks/init-hooks.js b/test/async-hooks/init-hooks.js
index 5d69703660..2c5167156b 100644
--- a/test/async-hooks/init-hooks.js
+++ b/test/async-hooks/init-hooks.js
@@ -27,7 +27,7 @@ class ActivityCollector {
ondestroy,
onpromiseResolve,
logid = null,
- logtype = null
+ logtype = null,
} = {}) {
this._start = start;
this._allowNoInit = allowNoInit;
@@ -49,7 +49,7 @@ class ActivityCollector {
before: this._before.bind(this),
after: this._after.bind(this),
destroy: this._destroy.bind(this),
- promiseResolve: this._promiseResolve.bind(this)
+ promiseResolve: this._promiseResolve.bind(this),
});
}
@@ -181,7 +181,7 @@ class ActivityCollector {
// In some cases (e.g. Timeout) the handle is a function, thus the usual
// `typeof handle === 'object' && handle !== null` check can't be used.
handleIsObject: handle instanceof Object,
- handle
+ handle,
};
this._stamp(activity, 'init');
this._activities.set(uid, activity);
@@ -233,7 +233,7 @@ exports = module.exports = function initHooks({
onpromiseResolve,
allowNoInit,
logid,
- logtype
+ logtype,
} = {}) {
return new ActivityCollector(process.hrtime(), {
oninit,
@@ -243,6 +243,6 @@ exports = module.exports = function initHooks({
onpromiseResolve,
allowNoInit,
logid,
- logtype
+ logtype,
});
};
diff --git a/test/async-hooks/test-async-await.js b/test/async-hooks/test-async-await.js
index 19a22d3076..4fd698c8e9 100644
--- a/test/async-hooks/test-async-await.js
+++ b/test/async-hooks/test-async-await.js
@@ -22,7 +22,7 @@ const hooks = initHooks({
onbefore,
onafter,
ondestroy: null, // Intentionally not tested, since it will be removed soon
- onpromiseResolve
+ onpromiseResolve,
});
hooks.enable();
diff --git a/test/async-hooks/test-async-exec-resource-http-32060.js b/test/async-hooks/test-async-exec-resource-http-32060.js
index 0ff68aa107..1423179d42 100644
--- a/test/async-hooks/test-async-exec-resource-http-32060.js
+++ b/test/async-hooks/test-async-exec-resource-http-32060.js
@@ -12,7 +12,7 @@ const hooked = {};
createHook({
init(asyncId, type, triggerAsyncId, resource) {
hooked[asyncId] = resource;
- }
+ },
}).enable();
const server = http.createServer((req, res) => {
diff --git a/test/async-hooks/test-async-exec-resource-http.js b/test/async-hooks/test-async-exec-resource-http.js
index ecc654bea0..844720250d 100644
--- a/test/async-hooks/test-async-exec-resource-http.js
+++ b/test/async-hooks/test-async-exec-resource-http.js
@@ -13,7 +13,7 @@ const hooked = {};
createHook({
init(asyncId, type, triggerAsyncId, resource) {
hooked[asyncId] = resource;
- }
+ },
}).enable();
const server = http.createServer((req, res) => {
diff --git a/test/async-hooks/test-async-exec-resource-match.js b/test/async-hooks/test-async-exec-resource-match.js
index f5ea2c2b13..6174768ba7 100644
--- a/test/async-hooks/test-async-exec-resource-match.js
+++ b/test/async-hooks/test-async-exec-resource-match.js
@@ -6,7 +6,7 @@ const { readFile } = require('fs');
const {
createHook,
executionAsyncResource,
- AsyncResource
+ AsyncResource,
} = require('async_hooks');
// Ignore any asyncIds created before our hook is active.
@@ -32,7 +32,7 @@ createHook({
if (asyncId >= firstSeenAsyncId) {
afterHook(asyncId);
}
- }
+ },
}).enable();
const beforeHook = common.mustCallAtLeast(
diff --git a/test/async-hooks/test-async-local-storage-http-agent.js b/test/async-hooks/test-async-local-storage-http-agent.js
index 1de535aa70..54c8a585a5 100644
--- a/test/async-hooks/test-async-local-storage-http-agent.js
+++ b/test/async-hooks/test-async-local-storage-http-agent.js
@@ -7,7 +7,7 @@ const http = require('http');
const asyncLocalStorage = new AsyncLocalStorage();
const agent = new http.Agent({
- maxSockets: 1
+ maxSockets: 1,
});
const N = 3;
diff --git a/test/async-hooks/test-async-local-storage-stop-propagation.js b/test/async-hooks/test-async-local-storage-stop-propagation.js
index 3b63da71cb..0480bd4be7 100644
--- a/test/async-hooks/test-async-local-storage-stop-propagation.js
+++ b/test/async-hooks/test-async-local-storage-stop-propagation.js
@@ -18,7 +18,7 @@ function onPropagate(type, store) {
}
const als = new AsyncLocalStorage({
- onPropagate: common.mustCall(onPropagate, 2)
+ onPropagate: common.mustCall(onPropagate, 2),
});
const myStore = {};
@@ -40,11 +40,11 @@ als.run(myStore, common.mustCall(() => {
assert.throws(() => new AsyncLocalStorage(15), {
message: 'The "options" argument must be of type object. Received type number (15)',
code: 'ERR_INVALID_ARG_TYPE',
- name: 'TypeError'
+ name: 'TypeError',
});
assert.throws(() => new AsyncLocalStorage({ onPropagate: 'bar' }), {
message: 'The "options.onPropagate" property must be of type function. Received type string (\'bar\')',
code: 'ERR_INVALID_ARG_TYPE',
- name: 'TypeError'
+ name: 'TypeError',
});
diff --git a/test/async-hooks/test-async-local-storage-thenable.js b/test/async-hooks/test-async-local-storage-thenable.js
index 1f947fa934..3dc6841ac9 100644
--- a/test/async-hooks/test-async-local-storage-thenable.js
+++ b/test/async-hooks/test-async-local-storage-thenable.js
@@ -17,7 +17,7 @@ const then = common.mustCall((cb) => {
function thenable() {
return {
- then
+ then,
};
}
diff --git a/test/async-hooks/test-async-local-storage-tlssocket.js b/test/async-hooks/test-async-local-storage-tlssocket.js
index 34ea4c0682..09da3ac735 100644
--- a/test/async-hooks/test-async-local-storage-tlssocket.js
+++ b/test/async-hooks/test-async-local-storage-tlssocket.js
@@ -14,7 +14,7 @@ const { AsyncLocalStorage } = require('async_hooks');
const options = {
cert: fixtures.readKey('rsa_cert.crt'),
key: fixtures.readKey('rsa_private.pem'),
- rejectUnauthorized: false
+ rejectUnauthorized: false,
};
tls
diff --git a/test/async-hooks/test-callback-error.js b/test/async-hooks/test-callback-error.js
index 5665464c2d..f6af8e0018 100644
--- a/test/async-hooks/test-callback-error.js
+++ b/test/async-hooks/test-callback-error.js
@@ -9,14 +9,14 @@ const arg = process.argv[2];
switch (arg) {
case 'test_init_callback':
initHooks({
- oninit: common.mustCall(() => { throw new Error(arg); })
+ oninit: common.mustCall(() => { throw new Error(arg); }),
}).enable();
new async_hooks.AsyncResource(`${arg}_type`);
return;
case 'test_callback': {
initHooks({
- onbefore: common.mustCall(() => { throw new Error(arg); })
+ onbefore: common.mustCall(() => { throw new Error(arg); }),
}).enable();
const resource = new async_hooks.AsyncResource(`${arg}_type`);
resource.runInAsyncScope(() => {});
@@ -25,7 +25,7 @@ switch (arg) {
case 'test_callback_abort':
initHooks({
- oninit: common.mustCall(() => { throw new Error(arg); })
+ oninit: common.mustCall(() => { throw new Error(arg); }),
}).enable();
new async_hooks.AsyncResource(`${arg}_type`);
return;
diff --git a/test/async-hooks/test-destroy-not-blocked.js b/test/async-hooks/test-destroy-not-blocked.js
index aa467f3014..b9a3140724 100644
--- a/test/async-hooks/test-destroy-not-blocked.js
+++ b/test/async-hooks/test-destroy-not-blocked.js
@@ -23,7 +23,7 @@ createHook({
if (activeId === id) {
activeId = -1;
}
- }
+ },
}).enable();
function testNextTick() {
@@ -33,7 +33,7 @@ function testNextTick() {
res.emitDestroy();
// nextTick has higher prio than emit destroy
process.nextTick(common.mustCall(() =>
- assert.strictEqual(activeId, res.asyncId()))
+ assert.strictEqual(activeId, res.asyncId())),
);
}
@@ -44,7 +44,7 @@ function testQueueMicrotask() {
res.emitDestroy();
// queueMicrotask has higher prio than emit destroy
queueMicrotask(common.mustCall(() =>
- assert.strictEqual(activeId, res.asyncId()))
+ assert.strictEqual(activeId, res.asyncId())),
);
}
@@ -54,7 +54,7 @@ function testImmediate() {
assert.strictEqual(activeId, res.asyncId());
res.emitDestroy();
setImmediate(common.mustCall(() =>
- assert.strictEqual(activeId, -1))
+ assert.strictEqual(activeId, -1)),
);
}
@@ -65,7 +65,7 @@ function testPromise() {
res.emitDestroy();
// Promise has higher prio than emit destroy
Promise.resolve().then(common.mustCall(() =>
- assert.strictEqual(activeId, res.asyncId()))
+ assert.strictEqual(activeId, res.asyncId())),
);
}
diff --git a/test/async-hooks/test-disable-in-init.js b/test/async-hooks/test-disable-in-init.js
index 17537c62f3..f810dfca3b 100644
--- a/test/async-hooks/test-disable-in-init.js
+++ b/test/async-hooks/test-disable-in-init.js
@@ -13,11 +13,11 @@ async_hooks.createHook({
nestedCall = true;
fs.access(__filename, common.mustCall());
}
- }, 2)
+ }, 2),
}).enable();
const nestedHook = async_hooks.createHook({
- init: common.mustCall(2)
+ init: common.mustCall(2),
}).enable();
fs.access(__filename, common.mustCall());
diff --git a/test/async-hooks/test-embedder.api.async-resource-no-type.js b/test/async-hooks/test-embedder.api.async-resource-no-type.js
index 2600325e1e..e21c5458df 100644
--- a/test/async-hooks/test-embedder.api.async-resource-no-type.js
+++ b/test/async-hooks/test-embedder.api.async-resource-no-type.js
@@ -20,7 +20,7 @@ if (process.argv[2] === 'child') {
[null, undefined, 1, Date, {}, []].forEach((i) => {
assert.throws(() => new Foo(i), {
code: 'ERR_INVALID_ARG_TYPE',
- name: 'TypeError'
+ name: 'TypeError',
});
});
diff --git a/test/async-hooks/test-embedder.api.async-resource.js b/test/async-hooks/test-embedder.api.async-resource.js
index c53590393a..d60c03fb87 100644
--- a/test/async-hooks/test-embedder.api.async-resource.js
+++ b/test/async-hooks/test-embedder.api.async-resource.js
@@ -26,7 +26,7 @@ assert.throws(() => {
assert.strictEqual(
new AsyncResource('default_trigger_id').triggerAsyncId(),
- async_hooks.executionAsyncId()
+ async_hooks.executionAsyncId(),
);
// Create first custom event 'alcazares' with triggerAsyncId derived
diff --git a/test/async-hooks/test-emit-after-on-destroyed.js b/test/async-hooks/test-emit-after-on-destroyed.js
index 37c54b1c9e..1a10a1dfc7 100644
--- a/test/async-hooks/test-emit-after-on-destroyed.js
+++ b/test/async-hooks/test-emit-after-on-destroyed.js
@@ -10,7 +10,7 @@ const heartbeatMsg = /heartbeat: still alive/;
const {
newAsyncId, getDefaultTriggerAsyncId,
- emitInit, emitBefore, emitAfter, emitDestroy
+ emitInit, emitBefore, emitAfter, emitDestroy,
} = internal_async_hooks;
const initHooks = require('./init-hooks');
diff --git a/test/async-hooks/test-emit-before-after.js b/test/async-hooks/test-emit-before-after.js
index 2ad98b993e..561004cac2 100644
--- a/test/async-hooks/test-emit-before-after.js
+++ b/test/async-hooks/test-emit-before-after.js
@@ -30,7 +30,7 @@ const checkOnce = (fn) => {
initHooks({
onbefore: checkOnce(chkBefore),
onafter: checkOnce(chkAfter),
- allowNoInit: true
+ allowNoInit: true,
}).enable();
async_hooks.emitInit(expectedId, expectedType, expectedTriggerId);
diff --git a/test/async-hooks/test-emit-before-on-destroyed.js b/test/async-hooks/test-emit-before-on-destroyed.js
index 7b56eeeb63..ca0553e533 100644
--- a/test/async-hooks/test-emit-before-on-destroyed.js
+++ b/test/async-hooks/test-emit-before-on-destroyed.js
@@ -10,7 +10,7 @@ const heartbeatMsg = /heartbeat: still alive/;
const {
newAsyncId, getDefaultTriggerAsyncId,
- emitInit, emitBefore, emitAfter, emitDestroy
+ emitInit, emitBefore, emitAfter, emitDestroy,
} = internal_async_hooks;
const initHooks = require('./init-hooks');
diff --git a/test/async-hooks/test-emit-init.js b/test/async-hooks/test-emit-init.js
index bc1cd49cba..8994943b47 100644
--- a/test/async-hooks/test-emit-init.js
+++ b/test/async-hooks/test-emit-init.js
@@ -17,7 +17,7 @@ const hooks1 = initHooks({
assert.strictEqual(type, expectedType);
assert.strictEqual(triggerAsyncId, expectedTriggerId);
assert.strictEqual(resource.key, expectedResource.key);
- })
+ }),
});
hooks1.enable();
@@ -33,7 +33,7 @@ initHooks({
assert.strictEqual(type, expectedType);
assert.notStrictEqual(triggerAsyncId, expectedTriggerId);
assert.strictEqual(resource.key, expectedResource.key);
- })
+ }),
}).enable();
async_hooks.emitInit(expectedId, expectedType, null, expectedResource);
diff --git a/test/async-hooks/test-enable-in-init.js b/test/async-hooks/test-enable-in-init.js
index 7bc70994e1..e710657a34 100644
--- a/test/async-hooks/test-enable-in-init.js
+++ b/test/async-hooks/test-enable-in-init.js
@@ -5,7 +5,7 @@ const async_hooks = require('async_hooks');
const fs = require('fs');
const nestedHook = async_hooks.createHook({
- init: common.mustNotCall()
+ init: common.mustNotCall(),
});
let nestedCall = false;
@@ -16,7 +16,7 @@ async_hooks.createHook({
nestedCall = true;
fs.access(__filename, common.mustCall());
}
- }, 2)
+ }, 2),
}).enable();
fs.access(__filename, common.mustCall());
diff --git a/test/async-hooks/test-filehandle-no-reuse.js b/test/async-hooks/test-filehandle-no-reuse.js
index 7cd3322c19..34921471e4 100644
--- a/test/async-hooks/test-filehandle-no-reuse.js
+++ b/test/async-hooks/test-filehandle-no-reuse.js
@@ -17,7 +17,7 @@ const hooks = initHooks();
hooks.enable();
const {
- HTTP2_HEADER_CONTENT_TYPE
+ HTTP2_HEADER_CONTENT_TYPE,
} = http2.constants;
// Use large fixture to get several file operations.
@@ -27,7 +27,7 @@ const fd = fs.openSync(fname, 'r');
const server = http2.createServer();
server.on('stream', (stream) => {
stream.respondWithFD(fd, {
- [HTTP2_HEADER_CONTENT_TYPE]: 'text/plain'
+ [HTTP2_HEADER_CONTENT_TYPE]: 'text/plain',
});
});
server.on('close', common.mustCall(() => fs.closeSync(fd)));
diff --git a/test/async-hooks/test-graph.fsreq-readFile.js b/test/async-hooks/test-graph.fsreq-readFile.js
index 0a310ed577..543ce68aa7 100644
--- a/test/async-hooks/test-graph.fsreq-readFile.js
+++ b/test/async-hooks/test-graph.fsreq-readFile.js
@@ -21,6 +21,6 @@ function onexit() {
[ { type: 'FSREQCALLBACK', id: 'fsreq:1', triggerAsyncId: null },
{ type: 'FSREQCALLBACK', id: 'fsreq:2', triggerAsyncId: 'fsreq:1' },
{ type: 'FSREQCALLBACK', id: 'fsreq:3', triggerAsyncId: 'fsreq:2' },
- { type: 'FSREQCALLBACK', id: 'fsreq:4', triggerAsyncId: 'fsreq:3' } ]
+ { type: 'FSREQCALLBACK', id: 'fsreq:4', triggerAsyncId: 'fsreq:3' } ],
);
}
diff --git a/test/async-hooks/test-graph.http.js b/test/async-hooks/test-graph.http.js
index 62d27fe1b5..859000b14a 100644
--- a/test/async-hooks/test-graph.http.js
+++ b/test/async-hooks/test-graph.http.js
@@ -20,7 +20,7 @@ server.listen(0, common.mustCall(() => {
http.get({
host: '::1',
family: 6,
- port: server.address().port
+ port: server.address().port,
}, common.mustCall());
}));
@@ -48,6 +48,6 @@ process.on('exit', () => {
triggerAsyncId: null },
{ type: 'SHUTDOWNWRAP',
id: 'shutdown:1',
- triggerAsyncId: 'tcp:2' } ]
+ triggerAsyncId: 'tcp:2' } ],
);
});
diff --git a/test/async-hooks/test-graph.intervals.js b/test/async-hooks/test-graph.intervals.js
index 8aa46ab07b..9e626951a1 100644
--- a/test/async-hooks/test-graph.intervals.js
+++ b/test/async-hooks/test-graph.intervals.js
@@ -30,6 +30,6 @@ function onexit() {
verifyGraph(
hooks,
[ { type: 'Timeout', id: 'timeout:1', triggerAsyncId: null },
- { type: 'Timeout', id: 'timeout:2', triggerAsyncId: 'timeout:1' }]
+ { type: 'Timeout', id: 'timeout:2', triggerAsyncId: 'timeout:1' }],
);
}
diff --git a/test/async-hooks/test-graph.pipe.js b/test/async-hooks/test-graph.pipe.js
index 162fb3639b..abf8a98ff0 100644
--- a/test/async-hooks/test-graph.pipe.js
+++ b/test/async-hooks/test-graph.pipe.js
@@ -27,6 +27,6 @@ function onexit() {
[ { type: 'PROCESSWRAP', id: 'process:1', triggerAsyncId: null },
{ type: 'PIPEWRAP', id: 'pipe:1', triggerAsyncId: null },
{ type: 'PIPEWRAP', id: 'pipe:2', triggerAsyncId: null },
- { type: 'PIPEWRAP', id: 'pipe:3', triggerAsyncId: null } ]
+ { type: 'PIPEWRAP', id: 'pipe:3', triggerAsyncId: null } ],
);
}
diff --git a/test/async-hooks/test-graph.pipeconnect.js b/test/async-hooks/test-graph.pipeconnect.js
index 440ea906a1..db237ff6b2 100644
--- a/test/async-hooks/test-graph.pipeconnect.js
+++ b/test/async-hooks/test-graph.pipeconnect.js
@@ -34,6 +34,6 @@ function onexit() {
{ type: 'PIPECONNECTWRAP', id: 'pipeconnect:1',
triggerAsyncId: 'pipe:1' },
{ type: 'PIPEWRAP', id: 'pipe:2', triggerAsyncId: 'pipeserver:1' },
- { type: 'SHUTDOWNWRAP', id: 'shutdown:1', triggerAsyncId: 'pipe:2' } ]
+ { type: 'SHUTDOWNWRAP', id: 'shutdown:1', triggerAsyncId: 'pipe:2' } ],
);
}
diff --git a/test/async-hooks/test-graph.shutdown.js b/test/async-hooks/test-graph.shutdown.js
index f4f077c0dd..0f633787e5 100644
--- a/test/async-hooks/test-graph.shutdown.js
+++ b/test/async-hooks/test-graph.shutdown.js
@@ -41,6 +41,6 @@ function onexit() {
{ type: 'TCPCONNECTWRAP',
id: 'tcpconnect:1', triggerAsyncId: 'tcp:1' },
{ type: 'TCPWRAP', id: 'tcp:2', triggerAsyncId: 'tcpserver:1' },
- { type: 'SHUTDOWNWRAP', id: 'shutdown:1', triggerAsyncId: 'tcp:2' } ]
+ { type: 'SHUTDOWNWRAP', id: 'shutdown:1', triggerAsyncId: 'tcp:2' } ],
);
}
diff --git a/test/async-hooks/test-graph.signal.js b/test/async-hooks/test-graph.signal.js
index b0a45ddf67..f87b1215b5 100644
--- a/test/async-hooks/test-graph.signal.js
+++ b/test/async-hooks/test-graph.signal.js
@@ -61,6 +61,6 @@ function onexit() {
{ type: 'PROCESSWRAP', id: 'process:3', triggerAsyncId: 'signal:1' },
{ type: 'PIPEWRAP', id: 'pipe:7', triggerAsyncId: 'signal:1' },
{ type: 'PIPEWRAP', id: 'pipe:8', triggerAsyncId: 'signal:1' },
- { type: 'PIPEWRAP', id: 'pipe:9', triggerAsyncId: 'signal:1' } ]
+ { type: 'PIPEWRAP', id: 'pipe:9', triggerAsyncId: 'signal:1' } ],
);
}
diff --git a/test/async-hooks/test-graph.statwatcher.js b/test/async-hooks/test-graph.statwatcher.js
index 96376926a6..f960ffebd3 100644
--- a/test/async-hooks/test-graph.statwatcher.js
+++ b/test/async-hooks/test-graph.statwatcher.js
@@ -29,6 +29,6 @@ function onexit() {
verifyGraph(
hooks,
[ { type: 'STATWATCHER', id: 'statwatcher:1', triggerAsyncId: null },
- { type: 'STATWATCHER', id: 'statwatcher:2', triggerAsyncId: null } ]
+ { type: 'STATWATCHER', id: 'statwatcher:2', triggerAsyncId: null } ],
);
}
diff --git a/test/async-hooks/test-graph.tcp.js b/test/async-hooks/test-graph.tcp.js
index c2253486ee..6f8db20add 100644
--- a/test/async-hooks/test-graph.tcp.js
+++ b/test/async-hooks/test-graph.tcp.js
@@ -43,6 +43,6 @@ function onexit() {
{ type: 'TCPCONNECTWRAP',
id: 'tcpconnect:1', triggerAsyncId: 'tcp:1' },
{ type: 'TCPWRAP', id: 'tcp:2', triggerAsyncId: 'tcpserver:1' },
- { type: 'SHUTDOWNWRAP', id: 'shutdown:1', triggerAsyncId: 'tcp:2' } ]
+ { type: 'SHUTDOWNWRAP', id: 'shutdown:1', triggerAsyncId: 'tcp:2' } ],
);
}
diff --git a/test/async-hooks/test-graph.timeouts.js b/test/async-hooks/test-graph.timeouts.js
index 2ec1420f0c..88350db2ba 100644
--- a/test/async-hooks/test-graph.timeouts.js
+++ b/test/async-hooks/test-graph.timeouts.js
@@ -27,6 +27,6 @@ function onexit() {
hooks,
[ { type: 'Timeout', id: 'timeout:1', triggerAsyncId: null },
{ type: 'Timeout', id: 'timeout:2', triggerAsyncId: 'timeout:1' },
- { type: 'Timeout', id: 'timeout:3', triggerAsyncId: 'timeout:2' }]
+ { type: 'Timeout', id: 'timeout:3', triggerAsyncId: 'timeout:2' }],
);
}
diff --git a/test/async-hooks/test-graph.tls-write.js b/test/async-hooks/test-graph.tls-write.js
index b493ac819d..243039e01d 100644
--- a/test/async-hooks/test-graph.tls-write.js
+++ b/test/async-hooks/test-graph.tls-write.js
@@ -21,7 +21,7 @@ hooks.enable();
const server = tls
.createServer({
cert: fixtures.readKey('rsa_cert.crt'),
- key: fixtures.readKey('rsa_private.pem')
+ key: fixtures.readKey('rsa_private.pem'),
})
.on('listening', common.mustCall(onlistening))
.on('secureConnection', common.mustCall(onsecureConnection))
@@ -66,6 +66,6 @@ function onexit() {
id: 'tcpconnect:1', triggerAsyncId: 'tcp:1' },
{ type: 'TCPWRAP', id: 'tcp:2', triggerAsyncId: 'tcpserver:1' },
{ type: 'TLSWRAP', id: 'tls:2', triggerAsyncId: 'tcpserver:1' },
- ]
+ ],
);
}
diff --git a/test/async-hooks/test-http-agent-handle-reuse-parallel.js b/test/async-hooks/test-http-agent-handle-reuse-parallel.js
index 844ba1e9f9..f60369a8b5 100644
--- a/test/async-hooks/test-http-agent-handle-reuse-parallel.js
+++ b/test/async-hooks/test-http-agent-handle-reuse-parallel.js
@@ -21,7 +21,7 @@ let responses = 0;
const agent = new http.Agent({
keepAlive: true,
keepAliveMsecs: Infinity,
- maxSockets: 1
+ maxSockets: 1,
});
const verifyRequest = (idx) => (res) => {
@@ -58,13 +58,13 @@ const server = http.createServer(common.mustCall((req, res) => {
// First request.
const r1 = http.request({
- agent, port, method: 'POST'
+ agent, port, method: 'POST',
}, common.mustCall(verifyRequest(0)));
r1.end(payload);
// Second request. Sent in parallel with the first one.
const r2 = http.request({
- agent, port, method: 'POST'
+ agent, port, method: 'POST',
}, common.mustCall(verifyRequest(1)));
r2.end(payload);
}));
diff --git a/test/async-hooks/test-http-agent-handle-reuse-serial.js b/test/async-hooks/test-http-agent-handle-reuse-serial.js
index fbd1d43378..bae0698a0a 100644
--- a/test/async-hooks/test-http-agent-handle-reuse-serial.js
+++ b/test/async-hooks/test-http-agent-handle-reuse-serial.js
@@ -20,7 +20,7 @@ let asyncIdAtSecondReq;
const agent = new http.Agent({
keepAlive: true,
keepAliveMsecs: Infinity,
- maxSockets: 1
+ maxSockets: 1,
});
const server = http.createServer(common.mustCall((req, res) => {
@@ -38,7 +38,7 @@ const server = http.createServer(common.mustCall((req, res) => {
// First request. This is useless except for adding a socket to the
// agent’s pool for reuse.
const r1 = http.request({
- agent, port, method: 'POST'
+ agent, port, method: 'POST',
}, common.mustCall((res) => {
// Remember which socket we used.
const socket = res.socket;
@@ -60,8 +60,8 @@ const server = http.createServer(common.mustCall((req, res) => {
// response header has already been received.
const r2 = http.request({
agent, port, method: 'POST', headers: {
- 'Content-Length': payload.length
- }
+ 'Content-Length': payload.length,
+ },
}, common.mustCall((res) => {
asyncIdAtSecondReq = res.socket[async_id_symbol];
assert.ok(asyncIdAtSecondReq > 0, `${asyncIdAtSecondReq} > 0`);
diff --git a/test/async-hooks/test-httpparser-reuse.js b/test/async-hooks/test-httpparser-reuse.js
index 70248970df..f7ce2cd876 100644
--- a/test/async-hooks/test-httpparser-reuse.js
+++ b/test/async-hooks/test-httpparser-reuse.js
@@ -29,7 +29,7 @@ createHook({
if (resource[reused]) {
reusedParser.push(
- `resource reused: ${asyncId}, ${triggerAsyncId}, ${type}`
+ `resource reused: ${asyncId}, ${triggerAsyncId}, ${type}`,
);
}
resource[reused] = true;
@@ -40,7 +40,7 @@ createHook({
} else {
destroyed.push(asyncId);
}
- }
+ },
}).enable();
const server = http.createServer((req, res) => {
diff --git a/test/async-hooks/test-httpparser.request.js b/test/async-hooks/test-httpparser.request.js
index cd61aa25e3..40c01bc817 100644
--- a/test/async-hooks/test-httpparser.request.js
+++ b/test/async-hooks/test-httpparser.request.js
@@ -16,7 +16,7 @@ const REQUEST = HTTPParser.REQUEST;
const kOnHeadersComplete = HTTPParser.kOnHeadersComplete | 0;
const request = Buffer.from(
- 'GET /hello HTTP/1.1\r\n\r\n'
+ 'GET /hello HTTP/1.1\r\n\r\n',
);
const parser = new HTTPParser();
diff --git a/test/async-hooks/test-httpparser.response.js b/test/async-hooks/test-httpparser.response.js
index d6625661eb..64f0893c5a 100644
--- a/test/async-hooks/test-httpparser.response.js
+++ b/test/async-hooks/test-httpparser.response.js
@@ -21,7 +21,7 @@ const request = Buffer.from(
'Content-Type: text/plain\r\n' +
'Content-Length: 4\r\n' +
'\r\n' +
- 'pong'
+ 'pong',
);
const parser = new HTTPParser();
diff --git a/test/async-hooks/test-improper-order.js b/test/async-hooks/test-improper-order.js
index 800c7422b4..5452e2c6e0 100644
--- a/test/async-hooks/test-improper-order.js
+++ b/test/async-hooks/test-improper-order.js
@@ -10,7 +10,7 @@ const heartbeatMsg = /heartbeat: still alive/;
const {
newAsyncId, getDefaultTriggerAsyncId,
- emitInit, emitBefore, emitAfter
+ emitInit, emitBefore, emitAfter,
} = internal_async_hooks;
const initHooks = require('./init-hooks');
diff --git a/test/async-hooks/test-improper-unwind.js b/test/async-hooks/test-improper-unwind.js
index f2fbef2dbc..ea0eee025d 100644
--- a/test/async-hooks/test-improper-unwind.js
+++ b/test/async-hooks/test-improper-unwind.js
@@ -10,7 +10,7 @@ const heartbeatMsg = /heartbeat: still alive/;
const {
newAsyncId, getDefaultTriggerAsyncId,
- emitInit, emitBefore, emitAfter
+ emitInit, emitBefore, emitAfter,
} = internal_async_hooks;
const initHooks = require('./init-hooks');
diff --git a/test/async-hooks/test-late-hook-enable.js b/test/async-hooks/test-late-hook-enable.js
index 7ee1323adb..8512ed993d 100644
--- a/test/async-hooks/test-late-hook-enable.js
+++ b/test/async-hooks/test-late-hook-enable.js
@@ -37,7 +37,7 @@ const hook = async_hooks.createHook({
destroy: common.mustCall(() => {
hook.disable();
nextTest();
- }, 3)
+ }, 3),
});
nextTest();
diff --git a/test/async-hooks/test-nexttick-default-trigger.js b/test/async-hooks/test-nexttick-default-trigger.js
index 7d6d98c9ab..fa1ad2c561 100644
--- a/test/async-hooks/test-nexttick-default-trigger.js
+++ b/test/async-hooks/test-nexttick-default-trigger.js
@@ -23,6 +23,6 @@ process.on('exit', () => {
const as = hooks.activitiesOfTypes('TickObject');
checkInvocations(as[0], {
- init: 1, before: 1, after: 1, destroy: 1
+ init: 1, before: 1, after: 1, destroy: 1,
}, 'when process exits');
});
diff --git a/test/async-hooks/test-pipewrap.js b/test/async-hooks/test-pipewrap.js
index 0a4d082856..2d42e769cf 100644
--- a/test/async-hooks/test-pipewrap.js
+++ b/test/async-hooks/test-pipewrap.js
@@ -55,7 +55,7 @@ function onsleepClose() {
checkInvocations(
processwrap,
{ init: 1, before: 1, after: 1 },
- 'processwrap while in onsleepClose callback')
+ 'processwrap while in onsleepClose callback'),
);
}
diff --git a/test/async-hooks/test-queue-microtask.js b/test/async-hooks/test-queue-microtask.js
index 1e2029efe4..01200d4542 100644
--- a/test/async-hooks/test-queue-microtask.js
+++ b/test/async-hooks/test-queue-microtask.js
@@ -20,6 +20,6 @@ process.on('exit', () => {
const as = hooks.activitiesOfTypes('Microtask');
checkInvocations(as[0], {
- init: 1, before: 1, after: 1, destroy: 1
+ init: 1, before: 1, after: 1, destroy: 1,
}, 'when process exits');
});
diff --git a/test/async-hooks/test-tlswrap.js b/test/async-hooks/test-tlswrap.js
index 65a4087d16..6a8996e00f 100644
--- a/test/async-hooks/test-tlswrap.js
+++ b/test/async-hooks/test-tlswrap.js
@@ -25,7 +25,7 @@ tls.DEFAULT_MAX_VERSION = 'TLSv1.2';
const server = tls
.createServer({
cert: fixtures.readKey('rsa_cert.crt'),
- key: fixtures.readKey('rsa_private.pem')
+ key: fixtures.readKey('rsa_private.pem'),
})
.on('listening', common.mustCall(onlistening))
.on('secureConnection', common.mustCall(onsecureConnection))
diff --git a/test/async-hooks/test-ttywrap.readstream.js b/test/async-hooks/test-ttywrap.readstream.js
index e6fb3cdc28..7e27ffc5bf 100644
--- a/test/async-hooks/test-ttywrap.readstream.js
+++ b/test/async-hooks/test-ttywrap.readstream.js
@@ -35,7 +35,7 @@ const delayedOnCloseHandler = common.mustCall(() => {
});
process.stdin.on('error', (err) => assert.fail(err));
process.stdin.on('close', common.mustCall(() =>
- tick(2, delayedOnCloseHandler)
+ tick(2, delayedOnCloseHandler),
));
process.stdin.destroy();
checkInvocations(tty, checkInitOpts, 'when tty.end() was invoked');
diff --git a/test/async-hooks/test-unhandled-rejection-context.js b/test/async-hooks/test-unhandled-rejection-context.js
index b70d97f99f..8404cf71f0 100644
--- a/test/async-hooks/test-unhandled-rejection-context.js
+++ b/test/async-hooks/test-unhandled-rejection-context.js
@@ -15,7 +15,7 @@ const hooks = initHooks({
if (type === 'PROMISE') {
promiseAsyncIds.push(asyncId);
}
- }
+ },
});
hooks.enable();
diff --git a/test/async-hooks/test-zlib.zlib-binding.deflate.js b/test/async-hooks/test-zlib.zlib-binding.deflate.js
index 16d9b3f3eb..802f09eb30 100644
--- a/test/async-hooks/test-zlib.zlib-binding.deflate.js
+++ b/test/async-hooks/test-zlib.zlib-binding.deflate.js
@@ -29,7 +29,7 @@ const buffers = {
writeResult: new Uint32Array(2),
dictionary: new Uint8Array(0),
inBuf: new Uint8Array([0x78]),
- outBuf: new Uint8Array(1)
+ outBuf: new Uint8Array(1),
};
handle.init(
@@ -39,7 +39,7 @@ handle.init(
constants.Z_DEFAULT_STRATEGY,
buffers.writeResult,
function processCallback() { this.cb(); },
- buffers.dictionary
+ buffers.dictionary,
);
checkInvocations(hdl, { init: 1 }, 'when initialized handle');
diff --git a/test/async-hooks/verify-graph.js b/test/async-hooks/verify-graph.js
index 638edd03a4..61d1849f21 100644
--- a/test/async-hooks/verify-graph.js
+++ b/test/async-hooks/verify-graph.js
@@ -20,7 +20,7 @@ function pruneTickObjects(activities) {
const tickObject = {
found: true,
index: null,
- data: null
+ data: null,
};
if (!Array.isArray(activities))
@@ -42,7 +42,7 @@ function pruneTickObjects(activities) {
tickObject.data = activities[tickObject.index];
const triggerId = {
new: tickObject.data.triggerAsyncId,
- old: tickObject.data.uid
+ old: tickObject.data.uid,
};
activities.forEach(function repointTriggerId(x) {
@@ -85,7 +85,7 @@ module.exports = function verifyGraph(hooks, graph) {
errors.push({
id: node.id,
expectedTid: node.triggerAsyncId,
- actualTid: uidtoid[x.triggerAsyncId]
+ actualTid: uidtoid[x.triggerAsyncId],
});
}
@@ -93,8 +93,8 @@ module.exports = function verifyGraph(hooks, graph) {
errors.forEach((x) =>
console.error(
`'${x.id}' expected to be triggered by '${x.expectedTid}', ` +
- `but was triggered by '${x.actualTid}' instead.`
- )
+ `but was triggered by '${x.actualTid}' instead.`,
+ ),
);
}
assert.strictEqual(errors.length, 0);