[Pkg-javascript-commits] [node-module-deps] 255/444: failing expose example

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 15 09:48:01 UTC 2017


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

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

commit 1e30f2c71e9006b210e8f175c2569669def81312
Author: James Halliday <mail at substack.net>
Date:   Sun Jul 20 03:35:29 2014 -0700

    failing expose example
---
 test/expose.js | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/test/expose.js b/test/expose.js
new file mode 100644
index 0000000..0be9e37
--- /dev/null
+++ b/test/expose.js
@@ -0,0 +1,38 @@
+var parser = require('../');
+var test = require('tape');
+var fs = require('fs');
+
+var files = {
+    foo: __dirname + '/files/foo.js',
+    bar: __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',
+                source: sources.foo,
+                deps: { './bar': files.bar }
+            },
+            {
+                id: files.bar,
+                source: sources.bar,
+                deps: {}
+            }
+        ].sort(cmp));
+    });
+});
+
+function cmp (a, b) { return a.id < b.id ? -1 : 1 }

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



More information about the Pkg-javascript-commits mailing list