Skip to content

Commit bb4c293

Browse files
aduh95ruyadorno
authored andcommitted
test: add trailing commas in async-hooks tests (#45549)
PR-URL: #45549 Reviewed-By: Daeyeon Jeong <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]>
1 parent 731e874 commit bb4c293

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+78
-79
lines changed

test/.eslintrc.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ globals:
7272

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

test/async-hooks/hook-checks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ exports.checkInvocations = function checkInvocations(activity, hooks, stage) {
2121

2222
assert.ok(activity != null,
2323
`${stageInfo} Trying to check invocation for an activity, ` +
24-
'but it was empty/undefined.'
24+
'but it was empty/undefined.',
2525
);
2626

2727
// Check that actual invocations for all hooks match the expected invocations

test/async-hooks/init-hooks.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class ActivityCollector {
2727
ondestroy,
2828
onpromiseResolve,
2929
logid = null,
30-
logtype = null
30+
logtype = null,
3131
} = {}) {
3232
this._start = start;
3333
this._allowNoInit = allowNoInit;
@@ -49,7 +49,7 @@ class ActivityCollector {
4949
before: this._before.bind(this),
5050
after: this._after.bind(this),
5151
destroy: this._destroy.bind(this),
52-
promiseResolve: this._promiseResolve.bind(this)
52+
promiseResolve: this._promiseResolve.bind(this),
5353
});
5454
}
5555

@@ -181,7 +181,7 @@ class ActivityCollector {
181181
// In some cases (e.g. Timeout) the handle is a function, thus the usual
182182
// `typeof handle === 'object' && handle !== null` check can't be used.
183183
handleIsObject: handle instanceof Object,
184-
handle
184+
handle,
185185
};
186186
this._stamp(activity, 'init');
187187
this._activities.set(uid, activity);
@@ -233,7 +233,7 @@ exports = module.exports = function initHooks({
233233
onpromiseResolve,
234234
allowNoInit,
235235
logid,
236-
logtype
236+
logtype,
237237
} = {}) {
238238
return new ActivityCollector(process.hrtime(), {
239239
oninit,
@@ -243,6 +243,6 @@ exports = module.exports = function initHooks({
243243
onpromiseResolve,
244244
allowNoInit,
245245
logid,
246-
logtype
246+
logtype,
247247
});
248248
};

test/async-hooks/test-async-await.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const hooks = initHooks({
2222
onbefore,
2323
onafter,
2424
ondestroy: null, // Intentionally not tested, since it will be removed soon
25-
onpromiseResolve
25+
onpromiseResolve,
2626
});
2727
hooks.enable();
2828

test/async-hooks/test-async-exec-resource-http-32060.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const hooked = {};
1212
createHook({
1313
init(asyncId, type, triggerAsyncId, resource) {
1414
hooked[asyncId] = resource;
15-
}
15+
},
1616
}).enable();
1717

1818
const server = http.createServer((req, res) => {

test/async-hooks/test-async-exec-resource-http.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const hooked = {};
1313
createHook({
1414
init(asyncId, type, triggerAsyncId, resource) {
1515
hooked[asyncId] = resource;
16-
}
16+
},
1717
}).enable();
1818

1919
const server = http.createServer((req, res) => {

test/async-hooks/test-async-exec-resource-match.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const { readFile } = require('fs');
66
const {
77
createHook,
88
executionAsyncResource,
9-
AsyncResource
9+
AsyncResource,
1010
} = require('async_hooks');
1111

1212
// Ignore any asyncIds created before our hook is active.
@@ -32,7 +32,7 @@ createHook({
3232
if (asyncId >= firstSeenAsyncId) {
3333
afterHook(asyncId);
3434
}
35-
}
35+
},
3636
}).enable();
3737

3838
const beforeHook = common.mustCallAtLeast(

test/async-hooks/test-async-local-storage-http-agent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const http = require('http');
77
const asyncLocalStorage = new AsyncLocalStorage();
88

99
const agent = new http.Agent({
10-
maxSockets: 1
10+
maxSockets: 1,
1111
});
1212

1313
const N = 3;

test/async-hooks/test-async-local-storage-stop-propagation.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function onPropagate(type, store) {
1818
}
1919

2020
const als = new AsyncLocalStorage({
21-
onPropagate: common.mustCall(onPropagate, 2)
21+
onPropagate: common.mustCall(onPropagate, 2),
2222
});
2323

2424
const myStore = {};
@@ -40,11 +40,11 @@ als.run(myStore, common.mustCall(() => {
4040
assert.throws(() => new AsyncLocalStorage(15), {
4141
message: 'The "options" argument must be of type object. Received type number (15)',
4242
code: 'ERR_INVALID_ARG_TYPE',
43-
name: 'TypeError'
43+
name: 'TypeError',
4444
});
4545

4646
assert.throws(() => new AsyncLocalStorage({ onPropagate: 'bar' }), {
4747
message: 'The "options.onPropagate" property must be of type function. Received type string (\'bar\')',
4848
code: 'ERR_INVALID_ARG_TYPE',
49-
name: 'TypeError'
49+
name: 'TypeError',
5050
});

test/async-hooks/test-async-local-storage-thenable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const then = common.mustCall((cb) => {
1717

1818
function thenable() {
1919
return {
20-
then
20+
then,
2121
};
2222
}
2323

0 commit comments

Comments
 (0)