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", () => {
46
46
await page . keyboard . press ( "Enter" )
47
47
await page . waitForTimeout ( 2000 )
48
48
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 ( )
60
55
61
56
// TODO delete tmpFolder
62
57
} )
You can’t perform that action at this time.
0 commit comments