[Pkg-javascript-commits] [node-deps-sort] 19/79: expose string test
Bastien Roucariès
rouca at moszumanska.debian.org
Wed Sep 6 09:41:53 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 25bcc8cf981dbd0e37a8f57f447346e1dd71bdb1
Author: James Halliday <mail at substack.net>
Date: Mon Jul 21 05:30:51 2014 -0700
expose string test
---
test/expose_str.js | 44 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git a/test/expose_str.js b/test/expose_str.js
new file mode 100644
index 0000000..a498db2
--- /dev/null
+++ b/test/expose_str.js
@@ -0,0 +1,44 @@
+var sort = require('../');
+var test = require('tape');
+var through = require('through2');
+
+test('expose string', function (t) {
+ t.plan(1);
+ var s = sort({
+ index: true,
+ expose: {
+ 'f': '/foo.js',
+ 'b': '/bar.js'
+ }
+ });
+ var rows = [];
+ function write (row, enc, next) { rows.push(row); next() }
+ function end () {
+ t.deepEqual(rows, [
+ {
+ id: '/main.js',
+ deps: { './foo': '/foo.js' },
+ index: 1,
+ indexDeps: { './foo': 'f' }
+ },
+ {
+ id: 'b',
+ deps: {},
+ index: 'b',
+ indexDeps: {}
+ },
+ {
+ id: 'f',
+ deps: { './bar': '/bar.js' },
+ index: 'f',
+ indexDeps: { './bar': 'b' }
+ }
+ ]);
+ }
+ s.pipe(through.obj(write, end));
+
+ s.write({ id: '/main.js', deps: { './foo': '/foo.js' } });
+ s.write({ id: 'f', deps: { './bar': '/bar.js' } });
+ s.write({ id: 'b', deps: {} });
+ 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