[Pkg-javascript-commits] [node-labeled-stream-splicer] 03/14: passing test

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 15 09:43: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-labeled-stream-splicer.

commit 9b6963d52dd5477511f4b14681ac685a313479c4
Author: James Halliday <mail at substack.net>
Date:   Tue Jun 10 22:16:05 2014 -0700

    passing test
---
 test/bundle.js      | 27 +++++++++++++++++++++++++++
 test/bundle/bar.js  |  3 +++
 test/bundle/foo.js  |  5 +++++
 test/bundle/main.js |  2 ++
 test/bundle/xyz.js  |  2 ++
 5 files changed, 39 insertions(+)

diff --git a/test/bundle.js b/test/bundle.js
new file mode 100644
index 0000000..2cafc3c
--- /dev/null
+++ b/test/bundle.js
@@ -0,0 +1,27 @@
+var test = require('tape');
+var splicer = require('../');
+var through = require('through2');
+var deps = require('module-deps');
+var pack = require('browser-pack');
+var concat = require('concat-stream');
+
+test('bundle', function (t) {
+    t.plan(1);
+    
+    var pipeline = splicer.obj([
+        'deps', [ deps(__dirname + '/bundle/main.js') ],
+        'pack', [ pack({ raw: true }) ]
+    ]);
+    pipeline.pipe(concat(function (body) {
+        Function([ 'console' ], body.toString('utf8'))({ log: log });
+        function log (msg) {
+            t.equal(msg, 'main: 56055');
+        }
+    }));
+
+    pipeline.get('deps').push(through.obj(function (row, enc, next) {
+        row.source = row.source.replace(/111/g, '11111');
+        this.push(row);
+        next();
+    }));
+});
diff --git a/test/bundle/bar.js b/test/bundle/bar.js
new file mode 100644
index 0000000..c57fa53
--- /dev/null
+++ b/test/bundle/bar.js
@@ -0,0 +1,3 @@
+module.exports = function (n) {
+    return n * 100;
+};
diff --git a/test/bundle/foo.js b/test/bundle/foo.js
new file mode 100644
index 0000000..c62e638
--- /dev/null
+++ b/test/bundle/foo.js
@@ -0,0 +1,5 @@
+var bar = require('./bar');
+
+module.exports = function (n) {
+    return n * 111 + bar(n);
+};
diff --git a/test/bundle/main.js b/test/bundle/main.js
new file mode 100644
index 0000000..8c71d79
--- /dev/null
+++ b/test/bundle/main.js
@@ -0,0 +1,2 @@
+var foo = require('./foo');
+console.log('main: ' + foo(5));
diff --git a/test/bundle/xyz.js b/test/bundle/xyz.js
new file mode 100644
index 0000000..dff6877
--- /dev/null
+++ b/test/bundle/xyz.js
@@ -0,0 +1,2 @@
+var foo = require('./foo');
+console.log('xyz: ' + foo(6));

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-labeled-stream-splicer.git



More information about the Pkg-javascript-commits mailing list