Can there be an option to .file()
and .directory()
which cleans up files/directories on process.exit?
Example:
tempy.directory({ cleanup: true })
I've tried using tempy.file.task()
but Jest ignores tests enclosed in any external function.
Example:
describe("Sample test", () => {
tempy.file.task(tempFile => {
// Both these tests dont get executed by Jest
it("Sample 1", () => {
expect(true).toBeTruthy() // Wanted to use the file in here.
})
it("Sample 2", () => {
expect(true).toBeTruthy() // And the same file here again.
})
})
})
I can create a file/directory externally outside and then delete it myself, but that would be tedious. Temporary files on Windows don't get deleted automatically unlike on MacOS, so an option to cleanup on node process exit would be pretty convenient.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too