Skip to content

Commit 8524265

Browse files
committed
refactor: use beforeAll and afterAll
1 parent 294c04b commit 8524265

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

test/e2e/terminal.test.ts

+7-8
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,19 @@ test.describe("Integrated Terminal", () => {
2626
storageState,
2727
}
2828
}
29+
test.beforeAll(async () => {
30+
tmpFolderPath = await tmpdir("integrated-terminal")
31+
tmpFile = path.join(tmpFolderPath, testFileName)
32+
})
33+
2934
test.beforeEach(async ({ page }) => {
3035
codeServer = new CodeServer(page)
3136
await codeServer.setup()
32-
// NOTE@jsjoeio
33-
// We're not using tmpdir from src/node/constants
34-
// because Playwright doesn't fully support ES modules from
35-
// the erorrs I'm seeing
36-
tmpFolderPath = await tmpdir("integrated-terminal")
37-
tmpFile = path.join(tmpFolderPath, testFileName)
3837
})
3938

40-
test.afterEach(async () => {
39+
test.afterAll(async () => {
4140
// Ensure directory was removed
42-
fs.rmdirSync(tmpFolderPath, { recursive: true })
41+
await fs.promises.rmdir(tmpFolderPath, { recursive: true })
4342
})
4443

4544
test("should echo a string to a file", options, async ({ page }) => {

0 commit comments

Comments
 (0)