[Pkg-javascript-commits] [node-module-deps] 150/444: another passing relative tr test

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 15 09:47:51 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 f282ece702c7d7f5567604eb27de04fcb1ec774e
Author: James Halliday <mail at substack.net>
Date:   Fri Jan 3 19:08:47 2014 -0800

    another passing relative tr test
---
 test/files/tr_module/index.js  |  7 +++++++
 test/files/tr_rel/main.js      |  1 +
 test/files/tr_rel/package.json |  5 +++++
 test/files/tr_rel/xxx.js       |  7 +++++++
 test/tr_rel.js                 | 22 ++++++++++++++++++++++
 5 files changed, 42 insertions(+)

diff --git a/test/files/tr_module/index.js b/test/files/tr_module/index.js
new file mode 100644
index 0000000..f655423
--- /dev/null
+++ b/test/files/tr_module/index.js
@@ -0,0 +1,7 @@
+var through = require('through');
+
+module.exports = function (file) {
+    return through(function (buf) {
+        this.queue(String(buf).replace(/XXX/g, '123'));
+    });
+};
diff --git a/test/files/tr_rel/main.js b/test/files/tr_rel/main.js
new file mode 100644
index 0000000..f035522
--- /dev/null
+++ b/test/files/tr_rel/main.js
@@ -0,0 +1 @@
+console.log(XXX * 3)
diff --git a/test/files/tr_rel/package.json b/test/files/tr_rel/package.json
new file mode 100644
index 0000000..efba406
--- /dev/null
+++ b/test/files/tr_rel/package.json
@@ -0,0 +1,5 @@
+{
+  "browserify": {
+    "transform": [ "./xxx.js" ]
+  }
+}
diff --git a/test/files/tr_rel/xxx.js b/test/files/tr_rel/xxx.js
new file mode 100644
index 0000000..09a4d06
--- /dev/null
+++ b/test/files/tr_rel/xxx.js
@@ -0,0 +1,7 @@
+var through = require('through');
+
+module.exports = function (file) {
+    return through(function (buf) {
+        this.queue(String(buf).replace(/XXX/g, '111'));
+    });
+};
diff --git a/test/tr_rel.js b/test/tr_rel.js
new file mode 100644
index 0000000..de58643
--- /dev/null
+++ b/test/tr_rel.js
@@ -0,0 +1,22 @@
+var mdeps = require('../');
+var test = require('tape');
+var JSONStream = require('JSONStream');
+var packer = require('browser-pack');
+
+test('transform', function (t) {
+    t.plan(1);
+    var p = mdeps(__dirname + '/files/tr_rel/main.js', {
+        transformKey: [ 'browserify', 'transform' ]
+    });
+    var pack = packer();
+    
+    p.pipe(JSONStream.stringify()).pipe(pack);
+    
+    var src = '';
+    pack.on('data', function (buf) { src += buf });
+    pack.on('end', function () {
+        Function('console', src)({ log: function (msg) {
+            t.equal(msg, 333);
+        } });
+    });
+});

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