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 a1ccf07

Browse filesBrowse files
TrottMylesBorins
authored andcommitted
test: make test-os-checked-function work without test harness
Most tests in `test/parallel` work when invoked with `node` rather than `tools/test.py` but not test-os-checked-function because it doesn't load the `common` module initially, which means it won't get re-spawned with the necessary flags (in the Flags: comment, in this case --expose_internals). Now that common delays loading 'os' until it needs to load it, this test can load the common module and it will work from the command line without the test harness. Additionally, we now can remove a comment disabling a lint rule. PR-URL: #30914 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
1 parent 29f807e commit a1ccf07
Copy full SHA for a1ccf07

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

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

‎test/parallel/test-os-checked-function.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-os-checked-function.js
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
/* eslint-disable node-core/require-common-first */
21
'use strict';
32
// Flags: --expose_internals
43

4+
const common = require('../common');
55
const { internalBinding } = require('internal/test/binding');
66

77
// Monkey patch the os binding before requiring any other modules, including
@@ -12,7 +12,6 @@ internalBinding('os').getHomeDirectory = function(ctx) {
1212
ctx.message = 'baz';
1313
};
1414

15-
const common = require('../common');
1615
const os = require('os');
1716

1817
common.expectsError(os.homedir, {

0 commit comments

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