Permalink
Browse files

transform tests

  • Loading branch information...
substack committed Oct 28, 2015
1 parent e19f256 commit ec829dfac8380873ed8aee9c995220638082af55
Showing with 13 additions and 3 deletions.
  1. +1 −1 index.js
  2. +8 −2 test/tr_symlink.js
  3. +2 −0 test/tr_symlink/app/main.js
  4. +1 −0 test/tr_symlink/app/node_modules/bbb
  5. +1 −0 test/tr_symlink/b-module/index.js
View
@@ -484,7 +484,7 @@ Browserify.prototype._createDeps = function (opts) {
}
if (err) cb(err, file, pkg)
else if (file) fs.realpath(file, function (err, res) {
- cb(err, res, pkg);
+ cb(err, res, pkg, file);
});
else cb(err, null, pkg)
});
View
@@ -7,11 +7,17 @@ var test = require('tap').test;
var through = require('through2');
test('transform symlink', function (t) {
- t.plan(3);
- var expected = [ 9, 555 ];
+ t.plan(4);
+ var expected = [ 9, 555, 777 ];
var b = browserify(__dirname + '/tr_symlink/app/main.js', {
basedir: __dirname + '/tr_symlink/app'
});
+ b.transform(function (file) {
+ return through(function (buf, enc, next) {
+ this.push(String(buf).replace(/7/g, 9));
+ next();
+ })
+ });
b.bundle(function (err, src) {
t.ifError(err);
var c = { console: { log: log } };
@@ -1,4 +1,6 @@
var a = require('aaa');
+var b = require('bbb');
console.log(5);
console.log(a);
+console.log(b);

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -0,0 +1 @@
+module.exports = 777

0 comments on commit ec829df

Please sign in to comment.