Skip to content

Commit

Permalink
test: reduce fs calls in test-fs-existssync-false
Browse files Browse the repository at this point in the history
PR-URL: #54815
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
anonrig authored and aduh95 committed Sep 13, 2024
1 parent 440c256 commit d1a4114
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions test/parallel/test-fs-existssync-false.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@ tmpdir.refresh();
// Make a long path.
for (let i = 0; i < 50; i++) {
dir = `${dir}/1234567890`;
try {
fs.mkdirSync(dir, '0777');
} catch (e) {
if (e.code !== 'EEXIST') {
throw e;
}
}
}

fs.mkdirSync(dir, {
mode: '0777',
recursive: true,
});

// Test if file exists synchronously
assert(fs.existsSync(dir), 'Directory is not accessible');

Expand Down

0 comments on commit d1a4114

Please sign in to comment.