Skip to content

Commit 8f49b7c

Browse files
anonrigtargos
authored andcommitted
test: reduce fs calls in test-fs-existssync-false
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>
1 parent 096623b commit 8f49b7c

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

‎test/parallel/test-fs-existssync-false.js‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,13 @@ tmpdir.refresh();
1818
// Make a long path.
1919
for(leti=0;i<50;i++){
2020
dir=`${dir}/1234567890`;
21-
try{
22-
fs.mkdirSync(dir,'0777');
23-
}catch(e){
24-
if(e.code!=='EEXIST'){
25-
throwe;
26-
}
27-
}
2821
}
2922

23+
fs.mkdirSync(dir,{
24+
mode: '0777',
25+
recursive: true,
26+
});
27+
3028
// Test if file exists synchronously
3129
assert(fs.existsSync(dir),'Directory is not accessible');
3230

0 commit comments

Comments
 (0)