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: nodejs#52702
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
  • Loading branch information
ShogunPanda authored and sophoniie committed Jun 20, 2024
1 parent cc1e4c1 commit 66d2a3d
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 66d2a3d

Please sign in to comment.