tapjs / stack-utils

Captures and cleans stack traces.
https://www.npmjs.com/package/stack-utils
MIT License
190 stars 35 forks source link

Doesn't clean up `fs` properly #14

Closed sindresorhus closed 7 years ago

sindresorhus commented 8 years ago

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.

jamestalmage commented 8 years ago

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?

sindresorhus commented 8 years ago

All of them. You can find a full list of builtins here: https://github.com/sindresorhus/builtin-modules/blob/master/builtin-modules.json

sindresorhus commented 8 years ago

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: https://github.com/avajs/ava/issues/990

isaacs commented 7 years ago

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')).

isaacs commented 7 years ago

Fixed on 1.0.0