mirror of https://github.com/coder/code-server.git
Move temp test dirs under a `tests` sub-directory
This is to match the other tests that create temp directories. It also lets you clean up test temp directories all at once separately from other non-test temporary directories.
This commit is contained in:
parent
52cf2fcf29
commit
1789cd1bcb
|
@ -20,8 +20,8 @@ export const loggerModule = {
|
||||||
* These directories are placed under a single temporary code-server directory.
|
* These directories are placed under a single temporary code-server directory.
|
||||||
*/
|
*/
|
||||||
export async function tmpdir(testName: string): Promise<string> {
|
export async function tmpdir(testName: string): Promise<string> {
|
||||||
const dir = path.join(os.tmpdir(), "code-server")
|
const dir = path.join(os.tmpdir(), "code-server/tests")
|
||||||
await fs.promises.mkdir(dir, { recursive: true })
|
await fs.promises.mkdir(dir, { recursive: true })
|
||||||
|
|
||||||
return await fs.promises.mkdtemp(path.join(dir, `test-${testName}-`), { encoding: "utf8" })
|
return await fs.promises.mkdtemp(path.join(dir, `${testName}-`), { encoding: "utf8" })
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue