Skip to content

Commit ec829df

Browse files
author
James Halliday
committed
transform tests
1 parent e19f256 commit ec829df

File tree

5 files changed

+13
-3
lines changed

5 files changed

+13
-3
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ Browserify.prototype._createDeps = function (opts) {
484484
}
485485
if (err) cb(err, file, pkg)
486486
else if (file) fs.realpath(file, function (err, res) {
487-
cb(err, res, pkg);
487+
cb(err, res, pkg, file);
488488
});
489489
else cb(err, null, pkg)
490490
});

test/tr_symlink.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,17 @@ var test = require('tap').test;
77
var through = require('through2');
88

99
test('transform symlink', function (t) {
10-
t.plan(3);
11-
var expected = [ 9, 555 ];
10+
t.plan(4);
11+
var expected = [ 9, 555, 777 ];
1212
var b = browserify(__dirname + '/tr_symlink/app/main.js', {
1313
basedir: __dirname + '/tr_symlink/app'
1414
});
15+
b.transform(function (file) {
16+
return through(function (buf, enc, next) {
17+
this.push(String(buf).replace(/7/g, 9));
18+
next();
19+
})
20+
});
1521
b.bundle(function (err, src) {
1622
t.ifError(err);
1723
var c = { console: { log: log } };

test/tr_symlink/app/main.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
var a = require('aaa');
2+
var b = require('bbb');
23

34
console.log(5);
45
console.log(a);
6+
console.log(b);

test/tr_symlink/app/node_modules/bbb

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/tr_symlink/b-module/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = 777

0 commit comments

Comments
 (0)