sindresorhus / tempy

Get a random temporary file or directory path
MIT License
423 stars 26 forks source link

A way to test that I have cleaned all temporary things? #23

Closed papb closed 4 years ago

papb commented 4 years ago

I use tempy extensively in some of my projects. In one of those projects, I have some methods that create a lot of temporary files/folders and deletes them in the end.

I am currently writing automated tests for this project and I want to test that no temporary files/folders were left behind.

Some options I've considered:

Also, an implementation of this second idea in tempy would enable an easy solution to #11, in which cleaning up would be just a p-map one-liner deleting everything over that history.

sindresorhus commented 4 years ago

I am currently writing automated tests for this project and I want to test that no temporary files/folders were left behind.

It seems like https://github.com/sindresorhus/tempy/pull/12 would be a better solution for this.