Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1f3bc5e

Browse filesBrowse files
Trottdanielleadams
authored andcommitted
test: increase runInAsyncScope() coverage
We don't appear to have any test coverage for passing the `thisArg` argument to `runInAsyncScope()`. Test coverage stats seem to bear this out. Add a test for it. PR-URL: #36624 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
1 parent f623d5d commit 1f3bc5e
Copy full SHA for 1f3bc5e

File tree

Expand file treeCollapse file tree

1 file changed

+17
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+17
-0
lines changed
Open diff view settings
Collapse file
+17Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
'use strict';
2+
3+
// Test that passing thisArg to runInAsyncScope() works.
4+
5+
const common = require('../common');
6+
const assert = require('assert');
7+
const { AsyncResource } = require('async_hooks');
8+
9+
const thisArg = {};
10+
11+
const res = new AsyncResource('fhqwhgads');
12+
13+
function callback() {
14+
assert.strictEqual(this, thisArg);
15+
}
16+
17+
res.runInAsyncScope(common.mustCall(callback), thisArg);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.