[Pkg-javascript-commits] [node-module-deps] 148/444: passing test for a relative transform

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 189f88c572f966df7269dda71d8e4f186cf37948
Author: James Halliday <mail at substack.net>
Date:   Fri Jan 3 18:27:48 2014 -0800

    passing test for a relative transform
---
 test/files/tr_module/main.js      | 1 +
 test/files/tr_module/package.json | 5 +++++
 test/files/tr_module/xxx.js       | 7 +++++++
 test/tr_module.js                 | 2 +-
 4 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/test/files/tr_module/main.js b/test/files/tr_module/main.js
index 084b20e..19775fb 100644
--- a/test/files/tr_module/main.js
+++ b/test/files/tr_module/main.js
@@ -5,3 +5,4 @@ var g = require('g');
 t.equal(m(f(AAA)), 555, 'transformation scope');
 t.equal(g(3), 333, 'sub-transformation applied');
 t.equal(typeof GGG, 'undefined', 'GGG leak');
+t.equal(XXX, 123, 'XXX');
diff --git a/test/files/tr_module/package.json b/test/files/tr_module/package.json
new file mode 100644
index 0000000..efba406
--- /dev/null
+++ b/test/files/tr_module/package.json
@@ -0,0 +1,5 @@
+{
+  "browserify": {
+    "transform": [ "./xxx.js" ]
+  }
+}
diff --git a/test/files/tr_module/xxx.js b/test/files/tr_module/xxx.js
new file mode 100644
index 0000000..f655423
--- /dev/null
+++ b/test/files/tr_module/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, '123'));
+    });
+};
diff --git a/test/tr_module.js b/test/tr_module.js
index 255846a..0758b7d 100644
--- a/test/tr_module.js
+++ b/test/tr_module.js
@@ -4,7 +4,7 @@ var JSONStream = require('JSONStream');
 var packer = require('browser-pack');
 
 test('transform', function (t) {
-    t.plan(3);
+    t.plan(4);
     var p = mdeps(__dirname + '/files/tr_module/main.js', {
         transform: [ 'insert-aaa', 'insert-bbb' ],
         transformKey: [ 'browserify', 'transform' ]

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