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 337aef0

Browse filesBrowse files
ssample812targos
authored andcommitted
test: normalize location test-worker-process-cwd.js runs tests
This change sets the process' directory to __dirname in order to normalize where the test is ran. This addresses the situation that occurs when node is located in the root, and moving up a directory results in the same directory. In that case, an error was thrown because the test interpreted this as a failed directory change. Fixes: #28193 PR-URL: #28271 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 2053dd0 commit 337aef0
Copy full SHA for 337aef0

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

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

‎test/parallel/test-worker-process-cwd.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-worker-process-cwd.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ if (!process.env.HAS_STARTED_WORKER) {
1010
if (!isMainThread) {
1111
common.skip('This test can only run as main thread');
1212
}
13+
process.chdir(__dirname);
1314
const w = new Worker(__filename);
1415
process.chdir('..');
1516
w.on('message', common.mustCall((message) => {

0 commit comments

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