Closed papb closed 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.
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:
tempy
that keeps track of everything that has been created. To test that there are no leftovers, I loop over each path recorded in this wrapper and check that it doesn't exist. This looks better, but I was wondering if this would be interesting to exist in tempy itself, in the form of a method liketempy.getCreationHistory()
(name can be improved).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.