File tree Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -46,17 +46,12 @@ test.describe("Integrated Terminal", () => {
4646 await page . keyboard . press ( "Enter" )
4747 await page . waitForTimeout ( 2000 )
4848
49- let fileExists = false
50-
51- try {
52- // Check that the file exists
53- await fs . promises . access ( tmpFile , fs . constants . F_OK )
54- fileExists = true
55- } catch ( error ) {
56- console . error ( "Could not find file" )
57- }
58-
59- expect ( fileExists ) . toBe ( true )
49+ // .access checks if the file exists without opening it
50+ // it doesn't return anything hence why we expect it to
51+ // resolve to undefined
52+ // If the promise rejects (i.e. the file doesn't exist)
53+ // then the assertion will fail
54+ expect ( fs . promises . access ( tmpFile ) ) . resolves . toBeUndefined ( )
6055
6156 // TODO delete tmpFolder
6257 } )
You can’t perform that action at this time.
0 commit comments