Sha256: fd7cf1bebd22eaea34642f4e7c8aed2260eaa2a7df7969e1ddc5843152f20dc5

Contents?: true

Size: 934 Bytes

Versions: 7

Compression:

Stored size: 934 Bytes

Contents

var sort = require('../');
var test = require('tap').test;
var through = require('through2');

test('dedupe undef', function (t) {
    t.plan(1);
    var s = sort({ dedupe: true });
    var rows = [];
    function write (row, enc, next) { rows.push(row); next() }
    function end () {
        t.deepEqual(rows, [
            { id: '/bar.js', source: 'TWO' },
            { id: '/foo.js', source: 'TWO', dedupe: '/bar.js', sameDeps: true },
            {
                id: '/main.js',
                deps: { './foo': '/foo.js', './bar': '/bar.js' },
                source: 'ONE'
            }
        ]);
    }
    s.pipe(through.obj(write, end));
    
    s.write({
        id: '/main.js',
        deps: { './foo': '/foo.js', './bar': '/bar.js' },
        source: 'ONE'
    });
    s.write({
        id: '/foo.js',
        source: 'TWO'
    });
    s.write({
        id: '/bar.js',
        source: 'TWO'
    });
    s.end();
});

Version data entries

7 entries across 7 versions & 2 rubygems

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