Sha256: caca7a9e970be742a2df7fb2e2f10d597ca78abf3be6c7fa2da3c2b0b1882940

Contents?: true

Size: 826 Bytes

Versions: 3

Compression:

Stored size: 826 Bytes

Contents

var test = require('tap').test;
var path  = require('path')
var mdeps = require('../')

var core = ['events', 'util', 'dns', 'dgram', 'http', 'https', 'net', 'fs']

var collect = []

var entry = path.join(__dirname, 'files', 'filterable.js')

test('can filter core deps', function (t) {

    mdeps(entry, {
        filter: function (e) {
            return !~core.indexOf(e)
        }
    })
    .on('data', function (d) {
        collect.push(d)
        t.equal(d.id, entry)
        t.deepEqual(d.deps, {
            events: false,
            fs: false,
            net: false,
            https: false,
            dgram: false,
            dns: false
        })
        t.equal(d.entry, true)
    })
    .on('end', function () {
        console.error(collect)
        t.equal(collect.length, 1)
        t.end()
    })

})

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
sprockets-browserify-0.2.0 node_modules/browserify/node_modules/module-deps/test/filter.js
ruby-wisp-source-0.8.0 vendor/node_modules/browserify/node_modules/module-deps/test/filter.js
ruby-wisp-source-0.7.0 vendor/node_modules/browserify/node_modules/module-deps/test/filter.js