Archived
1
0

Move tmpdir test helper to test helpers file

This commit is contained in:
Asher
2021-05-05 11:02:34 -05:00
parent 0e4672f6b9
commit 52cf2fcf29
5 changed files with 33 additions and 29 deletions

View File

@ -1,14 +1,3 @@
import * as fs from "fs"
import * as os from "os"
import * as path from "path"
export const CODE_SERVER_ADDRESS = process.env.CODE_SERVER_ADDRESS || "http://localhost:8080"
export const PASSWORD = process.env.PASSWORD || "e45432jklfdsab"
export const STORAGE = process.env.STORAGE || ""
export async function tmpdir(testName: string): Promise<string> {
const dir = path.join(os.tmpdir(), "code-server")
await fs.promises.mkdir(dir, { recursive: true })
return await fs.promises.mkdtemp(path.join(dir, `test-${testName}-`), { encoding: "utf8" })
}