Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
  • Loading branch information
ssample812 committed Jun 17, 2019
commit 484814baca25df3c95d20a95a1cf7e2e2c8fa44d
1 change: 1 addition & 0 deletions test/parallel/test-worker-process-cwd.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ if (!process.env.HAS_STARTED_WORKER) {
if (!isMainThread) {
common.skip('This test can only run as main thread');
}
process.chdir(__dirname);
const w = new Worker(__filename);
process.chdir('..');
w.on('message', common.mustCall((message) => {
Expand Down