tapjs/stack-utils

Doesn't clean up `fs` properly

Closed this issue · 5 comments

In AVA:

import fs from 'fs';
import test from 'ava';

test.cb(() => {
    fs.exists('foo', () => {
        throw new Error('123');
    });
});

Results in:

❯ ava


  2 exceptions

  1. Uncaught Exception
  Error: 123
    test.js:6:9
    FSReqWrap.cb [as oncomplete] (fs.js:212:19)


  2. Test results were not received from test.js

The FSReqWrap.cb [as oncomplete] (fs.js:212:19) part should have been cleaned up.

The list of ignored modules was just copied from what node-tap had originally. I think I agree that fs should be added to the list, but while we are at it, a LOT of nodes internal modules missing from that list: https://github.com/nodejs/node/tree/master/lib

What other ones should be included? All of them?

This module also doesn't handle internal modules that are in subdirectories:

_combinedTickCallback (internal/process/next_tick.js:67:7)
process._tickCallback (internal/process/next_tick.js:98:9)

Node.js 6

The above is from: avajs/ava#990

I pulled this list out of mocha's reporters, if I remember correctly.

The way to do this consistently would be to remove any file in Object.keys(process.binding('natives')).

Fixed on 1.0.0