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 2f73e6e

Browse filesBrowse files
TrottMylesBorins
authored andcommitted
test: use mustCall in place of countdown in timers test
Use common.mustCall() in place of countdown in test-timers-immediate-unref. PR-URL: #32416 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent 6f06cf0 commit 2f73e6e
Copy full SHA for 2f73e6e

File tree

Expand file treeCollapse file tree

1 file changed

+2
-6
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-6
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-timers-immediate-unref.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-timers-immediate-unref.js
+2-6Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
'use strict';
22

33
const common = require('../common');
4-
const Countdown = require('../common/countdown');
5-
64
const assert = require('assert');
75

86
const immediate = setImmediate(() => {});
@@ -16,12 +14,10 @@ clearImmediate(immediate);
1614
setImmediate(common.mustCall(firstStep)).ref().unref().unref().ref();
1715

1816
function firstStep() {
19-
const countdown =
20-
new Countdown(2, common.mustCall(() => setImmediate(secondStep)));
2117
// Unrefed setImmediate executes if it was unrefed but something else keeps
2218
// the loop open
23-
setImmediate(() => countdown.dec()).unref();
24-
setTimeout(() => countdown.dec(), 50);
19+
setImmediate(common.mustCall()).unref();
20+
setTimeout(common.mustCall(() => { setImmediate(secondStep); }), 0);
2521
}
2622

2723
function secondStep() {

0 commit comments

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