Skip to content

Commit

Permalink
src: only apply fix in main thread
Browse files Browse the repository at this point in the history
PR-URL: #52702
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Marco Ippolito <[email protected]>
  • Loading branch information
ShogunPanda authored and targos committed May 8, 2024
1 parent e1cba97 commit 9c76c95
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/parallel/test-process-load-env-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,17 @@ describe('process.loadEnvFile()', () => {
const originalCwd = process.cwd();

try {
process.chdir(join(originalCwd, 'lib'));
if (common.isMainThread) {
process.chdir(join(originalCwd, 'lib'));
}

assert.throws(() => {
process.loadEnvFile();
}, { code: 'ENOENT', syscall: 'open', path: '.env' });
} finally {
process.chdir(originalCwd);
if (common.isMainThread) {
process.chdir(originalCwd);
}
}
});

Expand Down

0 comments on commit 9c76c95

Please sign in to comment.