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 87367ec

Browse filesBrowse files
quinnlangilleMylesBorins
authored andcommitted
test: removed mustCallAsync from common and added inside testcase
PR-URL: #23467 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent 99d39f9 commit 87367ec
Copy full SHA for 87367ec

File tree

Expand file treeCollapse file tree

4 files changed

+7
-21
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

4 files changed

+7
-21
lines changed
Open diff view settings
Collapse file

‎test/common/README.md‎

Copy file name to clipboardExpand all lines: test/common/README.md
-11Lines changed: 0 additions & 11 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -234,17 +234,6 @@ fail.
234234

235235
If `fn` is not provided, an empty function will be used.
236236

237-
### mustCallAsync([fn][, exact])
238-
* `fn` [&lt;Function>]
239-
* `exact` [&lt;number>] default = 1
240-
* return [&lt;Function>]
241-
242-
The same as `mustCall()`, except that it is also checked that the Promise
243-
returned by the function is fulfilled for each invocation of the function.
244-
245-
The return value of the wrapped function is the return value of the original
246-
function, if necessary wrapped as a promise.
247-
248237
### mustCallAtLeast([fn][, minimum])
249238
* `fn` [&lt;Function>] default = () => {}
250239
* `minimum` [&lt;number>] default = 1
Collapse file

‎test/common/index.js‎

Copy file name to clipboardExpand all lines: test/common/index.js
-7Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -308,12 +308,6 @@ function mustCallAtLeast(fn, minimum) {
308308
return _mustCallInner(fn, minimum, 'minimum');
309309
}
310310

311-
function mustCallAsync(fn, exact) {
312-
return mustCall((...args) => {
313-
return Promise.resolve(fn(...args)).then(mustCall((val) => val));
314-
}, exact);
315-
}
316-
317311
function _mustCallInner(fn, criteria = 1, field) {
318312
if (process._exiting)
319313
throw new Error('Cannot use common.mustCall*() in process exit handler');
@@ -721,7 +715,6 @@ module.exports = {
721715
isWindows,
722716
localIPv6Hosts,
723717
mustCall,
724-
mustCallAsync,
725718
mustCallAtLeast,
726719
mustNotCall,
727720
nodeProcessAborted,
Collapse file

‎test/common/index.mjs‎

Copy file name to clipboardExpand all lines: test/common/index.mjs
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ const {
2626
allowGlobals,
2727
mustCall,
2828
mustCallAtLeast,
29-
mustCallAsync,
3029
hasMultiLocalhost,
3130
skipIfEslintMissing,
3231
canCreateSymLink,
@@ -74,7 +73,6 @@ export {
7473
allowGlobals,
7574
mustCall,
7675
mustCallAtLeast,
77-
mustCallAsync,
7876
hasMultiLocalhost,
7977
skipIfEslintMissing,
8078
canCreateSymLink,
Collapse file

‎test/parallel/test-http2-backpressure.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http2-backpressure.js
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const makeDuplexPair = require('../common/duplexpair');
1212
{
1313
let req;
1414
const server = http2.createServer();
15-
server.on('stream', common.mustCallAsync(async (stream, headers) => {
15+
server.on('stream', mustCallAsync(async (stream, headers) => {
1616
stream.respond({
1717
'content-type': 'text/html',
1818
':status': 200
@@ -45,3 +45,9 @@ function event(ee, eventName) {
4545
ee.once(eventName, common.mustCall(resolve));
4646
});
4747
}
48+
49+
function mustCallAsync(fn, exact) {
50+
return common.mustCall((...args) => {
51+
return Promise.resolve(fn(...args)).then(common.mustCall((val) => val));
52+
}, exact);
53+
}

0 commit comments

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