module-deps icon indicating copy to clipboard operation
module-deps copied to clipboard

ignoreMissing not working

Open cellvia opened this issue 11 years ago • 1 comments

having pull request issues but if you add this at line 115

        if( !~file.indexOf(path.sep) ) return cb(new Error(
            'no path to module, and not in cache: "'+id+'" from file '
            + parent.filename
        ))

it will work... and if you need a test to verify

var mdeps = require('../');
var test = require('tape');

test('ignoreMissing should skip native modules if not cached', function (t) {
    t.plan(1);
    var p = mdeps({ignoreMissing: true});
    p.on('error', function(err){ t.fail(err) } );
    p.on('missing', function(msg){ t.pass(msg) } );
    p.write(__dirname + '/files/ignore.js');
    p.end();
});

with test/files/ignore.js:

require('fs');

cellvia avatar Sep 03 '14 21:09 cellvia

Bump.

chrisabrams avatar Oct 23 '14 14:10 chrisabrams