Mocha not exiting after test

I know it is a bit late to answer this, but I was facing a similar problem and saw your post.

In mocha 4.0.0, they changed the behavior of tests on finalization.From here:

If the mocha process is still alive after your tests seem "done", then your tests have scheduled something to happen (asynchronously) and haven't cleaned up after themselves properly. Did you leave a socket open?

In your case, it seems like a call to createReadStream() was never closed.

So, you have 2 options:

Option A: Close the fs and other streams open (recommended)

Option B: Run mocha with the --exit option.