mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 21:19:50 +01:00
test: reduce fs calls in test-fs-existssync-false
PR-URL: https://github.com/nodejs/node/pull/54815 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
parent
0f2f9b6b15
commit
cc780ddf1e
@ -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');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user