node-tmp: Dir is not cleaned when I hit ctrl+c

I’m using tmp package in unit tests with tmp.setGracefulCleanup();. I’m creating temp directory for tests with unsafeCleanup = true.

It works fine if I don’t hit ctrl+c to interrupt tests. Then the temp dir is not deleted. How can I get it deleted automatically in this case?

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 28

Commits related to this issue

Most upvoted comments

@JanBednarik thank your very much. I think that I have found the problem. There exists a SIGINT event and tmp should be listening on that, too. The only problem is that under Windows one must take a different approach. I will look into this.

@silkentrance Would it be possible to make some time to merge this? It would be very helpful for me.

Any news on that? Hope to be fixed soon~

This package might be helpful. It’s supposed to allow you to run code no matter how the process exits. It has Windows tests so presumably it works on Windows too.