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 610727d

Browse filesBrowse files
TrottMyles Borins
authored andcommitted
test: clarify role of domains in test
Add a comment to clarify how the tests work and their purpose. Also removes unnecessary assignment of domain module to a variable. PR-URL: #4474 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Julien Gilli <jgilli@fastmail.fm>
1 parent 0ceb314 commit 610727d
Copy full SHA for 610727d

File tree

Expand file treeCollapse file tree

3 files changed

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

3 files changed

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

‎test/parallel/test-microtask-queue-integration-domain.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-microtask-queue-integration-domain.js
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
'use strict';
22
require('../common');
33
var assert = require('assert');
4-
var domain = require('domain');
4+
5+
// Requiring the domain module here changes the function that is used by node to
6+
// call process.nextTick's callbacks to a variant that specifically handles
7+
// domains. We want to test this specific variant in this test, and so even if
8+
// the domain module is not used, this require call is needed and must not be
9+
// removed.
10+
require('domain');
511

612
var implementations = [
713
function(fn) {
Collapse file

‎test/parallel/test-microtask-queue-run-domain.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-microtask-queue-run-domain.js
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
'use strict';
22
require('../common');
33
var assert = require('assert');
4-
var domain = require('domain');
4+
5+
// Requiring the domain module here changes the function that is used by node to
6+
// call process.nextTick's callbacks to a variant that specifically handles
7+
// domains. We want to test this specific variant in this test, and so even if
8+
// the domain module is not used, this require call is needed and must not be
9+
// removed.
10+
require('domain');
511

612
function enqueueMicrotask(fn) {
713
Promise.resolve().then(fn);
Collapse file

‎test/parallel/test-microtask-queue-run-immediate-domain.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-microtask-queue-run-immediate-domain.js
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
'use strict';
22
require('../common');
33
var assert = require('assert');
4-
var domain = require('domain');
4+
5+
// Requiring the domain module here changes the function that is used by node to
6+
// call process.nextTick's callbacks to a variant that specifically handles
7+
// domains. We want to test this specific variant in this test, and so even if
8+
// the domain module is not used, this require call is needed and must not be
9+
// removed.
10+
require('domain');
511

612
function enqueueMicrotask(fn) {
713
Promise.resolve().then(fn);

0 commit comments

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