[Pkg-javascript-commits] [node-module-deps] 78/444: failing noparse test

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 15 09:47:44 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 bc7bc3d1bd9e30debdf0ce0b9f6cf1ddc2d847e3
Author: James Halliday <mail at substack.net>
Date:   Fri May 17 11:29:47 2013 -0700

    failing noparse test
---
 test/noparse.js | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/test/noparse.js b/test/noparse.js
new file mode 100644
index 0000000..16b6c6b
--- /dev/null
+++ b/test/noparse.js
@@ -0,0 +1,37 @@
+var parser = require('../');
+var test = require('tap').test;
+var fs = require('fs');
+
+var files = {
+    main: __dirname + '/files/main.js',
+    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('noParse', function (t) {
+    t.plan(1);
+    var p = parser(files.main, { noParse: [ files.foo ] });
+    var rows = [];
+    
+    p.on('data', function (row) { rows.push(row) });
+    p.on('end', function () {
+        t.same(rows, [
+            {
+                id: files.main,
+                source: sources.main,
+                entry: true,
+                deps: { './foo': files.foo }
+            },
+            {
+                id: files.foo,
+                source: sources.foo,
+                deps: {}
+            }
+        ]);
+    });
+});

-- 
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