Sha256: 41ef19483b02a669cadc7330eb3c7a606954b6a5832f1a7d1123b19f7205871b

Contents?: true

Size: 1.03 KB

Versions: 7

Compression:

Stored size: 1.03 KB

Contents

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

var files = {
    foo: path.join(__dirname, '/files/foo.js'),
    bar: path.join(__dirname, '/files/bar.js')
};

var sources = Object.keys(files).reduce(function (acc, file) {
    acc[file] = fs.readFileSync(files[file], 'utf8');
    return acc;
}, {});

test('single id export', function (t) {
    t.plan(1);
    var p = parser();
    p.end({ id: 'foo', file: files.foo, entry: false });
    
    var rows = [];
    p.on('data', function (row) { rows.push(row) });
    p.on('end', function () {
        t.same(rows.sort(cmp), [
            {
                id: 'foo',
                file: files.foo,
                source: sources.foo,
                deps: { './bar': files.bar }
            },
            {
                id: files.bar,
                file: files.bar,
                source: sources.bar,
                deps: {}
            }
        ].sort(cmp));
    });
});

function cmp (a, b) { return a.id < b.id ? -1 : 1 }

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
minimum_viable_product-0.0.11 test/dummy/node_modules/module-deps/test/expose.js
brwy_rails-0.0.6 test/dummy/node_modules/module-deps/test/expose.js
brwy_rails-0.0.5 test/dummy/node_modules/module-deps/test/expose.js
brwy_rails-0.0.4 test/dummy/node_modules/module-deps/test/expose.js
brwy_rails-0.0.3 test/dummy/node_modules/module-deps/test/expose.js
brwy_rails-0.0.2 test/dummy/node_modules/module-deps/test/expose.js
brwy_rails-0.0.1 test/dummy/node_modules/module-deps/test/expose.js