[Pkg-javascript-commits] [node-module-deps] 283/444: noparse row test

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 15 09:48:05 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 645ea2df3a5be689ad1ab0276273f5f18b84d1d7
Author: James Halliday <mail at substack.net>
Date:   Thu Jul 24 15:02:01 2014 -0700

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

diff --git a/test/noparse_row.js b/test/noparse_row.js
new file mode 100644
index 0000000..4f54129
--- /dev/null
+++ b/test/noparse_row.js
@@ -0,0 +1,37 @@
+var parser = require('../');
+var test = require('tape');
+var fs = require('fs');
+var concat = require('concat-stream');
+
+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 row', function (t) {
+    t.plan(1);
+    var p = parser();
+    p.end({ file: files.main, noparse: true });
+    var rows = [];
+    
+    p.on('data', function (row) { rows.push(row) });
+    p.on('end', function () {
+        t.deepEqual(rows.sort(cmp), [
+            {
+                id: files.main,
+                file: files.main,
+                source: sources.main,
+                entry: true,
+                noparse: true
+            }
+        ].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