[Pkg-javascript-commits] [node-deps-sort] 43/79: failing test for undef deps

Bastien Roucariès rouca at moszumanska.debian.org
Wed Sep 6 09:41:55 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-deps-sort.

commit 93585f0278da6ee97efbb027b41386b873ec9ef8
Author: James Halliday <mail at substack.net>
Date:   Wed Jul 30 13:01:30 2014 +1200

    failing test for undef deps
---
 test/dedupe_undef.js | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/test/dedupe_undef.js b/test/dedupe_undef.js
new file mode 100644
index 0000000..261a8cf
--- /dev/null
+++ b/test/dedupe_undef.js
@@ -0,0 +1,37 @@
+var sort = require('../');
+var test = require('tape');
+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();
+});

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-deps-sort.git



More information about the Pkg-javascript-commits mailing list