Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
transform tests
  • Loading branch information
X-oss-byte committed Oct 28, 2015
1 parent e19f256 commit ec829df
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -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)
});
Expand Down
10 changes: 8 additions & 2 deletions test/tr_symlink.js
Expand Up @@ -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 } };
Expand Down
2 changes: 2 additions & 0 deletions test/tr_symlink/app/main.js
@@ -1,4 +1,6 @@
var a = require('aaa');
var b = require('bbb');

console.log(5);
console.log(a);
console.log(b);
1 change: 1 addition & 0 deletions test/tr_symlink/app/node_modules/bbb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions test/tr_symlink/b-module/index.js
@@ -0,0 +1 @@
module.exports = 777

0 comments on commit ec829df

Please sign in to comment.