We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3be2656 commit ecc7d6aCopy full SHA for ecc7d6a
test/e2e/terminal.test.ts
@@ -46,17 +46,12 @@ test.describe("Integrated Terminal", () => {
46
await page.keyboard.press("Enter")
47
await page.waitForTimeout(2000)
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)
+ // .access checks if the file exists without opening it
+ // it doesn't return anything hence why we expect it to
+ // resolve to undefined
+ // If the promise rejects (i.e. the file doesn't exist)
+ // then the assertion will fail
+ expect(fs.promises.access(tmpFile)).resolves.toBeUndefined()
60
61
// TODO delete tmpFolder
62
})
0 commit comments