File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
packages/core/src/test/shared/fs Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -411,16 +411,20 @@ describe('FileSystem', function () {
411411 const oldPath = testFolder . pathFrom ( 'oldFile.txt' )
412412 const newPath = testFolder . pathFrom ( 'newFile.txt' )
413413
414- const result = fs . rename ( oldPath , newPath )
415- // this file is created after the first "exists" check fails, the following check should pass
416- void testutil . toFile ( 'hello world' , oldPath )
417- await result
414+ const existsStub = Sinon . stub ( FileSystem . prototype , 'exists' )
415+ existsStub . onFirstCall ( ) . resolves ( false )
416+ existsStub . callThrough ( )
417+
418+ await testutil . toFile ( 'hello world' , oldPath )
419+ await fs . rename ( oldPath , newPath )
418420
419421 testutil . assertTelemetry ( 'ide_fileSystem' , {
420422 action : 'rename' ,
421423 result : 'Succeeded' ,
422424 reason : 'RenameRaceCondition' ,
423425 } )
426+
427+ existsStub . restore ( )
424428 } )
425429 } )
426430
You can’t perform that action at this time.
0 commit comments