[Pkg-javascript-commits] [node-deps-sort] 47/79: failing test for dedupe deps of deps
Bastien Roucariès
rouca at moszumanska.debian.org
Wed Sep 6 09:41:56 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 f8f484b33e5bdefd8506bf1c31c1c522f69b28f4
Author: Maximilian Antoni <mail at maxantoni.de>
Date: Mon Aug 11 16:34:00 2014 +0200
failing test for dedupe deps of deps
---
test/dedupe-deps-of-deps.js | 71 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 71 insertions(+)
diff --git a/test/dedupe-deps-of-deps.js b/test/dedupe-deps-of-deps.js
new file mode 100644
index 0000000..b2963a3
--- /dev/null
+++ b/test/dedupe-deps-of-deps.js
@@ -0,0 +1,71 @@
+var sort = require('../');
+var test = require('tape');
+var through = require('through2');
+
+test('dedupe-deps-of-deps', 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',
+ deps: { baz: '/bar/baz.js' },
+ source: 'TWO'
+ },
+ {
+ id: '/bar/baz.js',
+ deps: {},
+ source: 'THREE'
+ },
+ {
+ id: '/foo.js',
+ deps: { baz: '/foo/baz.js' },
+ source: 'TWO',
+ dedupe: '/bar.js',
+ sameDeps: true
+ },
+ {
+ id: '/foo/baz.js',
+ deps: {},
+ source: 'THREE',
+ dedupe: '/bar/baz.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',
+ deps: { baz : '/foo/baz.js' },
+ source: 'TWO'
+ });
+ s.write({
+ id: '/bar.js',
+ deps: { baz : '/bar/baz.js' },
+ source: 'TWO'
+ });
+ s.write({
+ id: '/foo/baz.js',
+ deps: {},
+ source: 'THREE'
+ });
+ s.write({
+ id: '/bar/baz.js',
+ deps: {},
+ source: 'THREE'
+ });
+ 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