Skip to content

Commit

Permalink
refactor: use beforeAll and afterAll
Browse files Browse the repository at this point in the history
  • Loading branch information
jsjoeio committed Apr 23, 2021
1 parent 294c04b commit 8524265
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions test/e2e/terminal.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,19 @@ test.describe("Integrated Terminal", () => {
storageState,
}
}
test.beforeAll(async () => {
tmpFolderPath = await tmpdir("integrated-terminal")
tmpFile = path.join(tmpFolderPath, testFileName)
})

test.beforeEach(async ({ page }) => {
codeServer = new CodeServer(page)
await codeServer.setup()
// NOTE@jsjoeio
// We're not using tmpdir from src/node/constants
// because Playwright doesn't fully support ES modules from
// the erorrs I'm seeing
tmpFolderPath = await tmpdir("integrated-terminal")
tmpFile = path.join(tmpFolderPath, testFileName)
})

test.afterEach(async () => {
test.afterAll(async () => {
// Ensure directory was removed
fs.rmdirSync(tmpFolderPath, { recursive: true })
await fs.promises.rmdir(tmpFolderPath, { recursive: true })
})

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

0 comments on commit 8524265

Please sign in to comment.