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,5 +1,3 @@
import * as fs from "fs"
import { tmpdir } from "../../test/utils/constants"
import { loggerModule } from "../utils/helpers"
// jest.mock is hoisted above the imports so we must use `require` here.
@ -89,16 +87,3 @@ describe("constants", () => {
})
})
})
describe("test constants", () => {
describe("tmpdir", () => {
it("should return a temp directory", async () => {
const testName = "temp-dir"
const pathToTempDir = await tmpdir(testName)
expect(pathToTempDir).toContain(testName)
await fs.promises.rmdir(pathToTempDir)
})
})
})