1 |
|
2 |
|
3 |
|
4 | var browserify = require('../');
|
5 | var vm = require('vm');
|
6 | var test = require('tap').test;
|
7 | var through = require('through2');
|
8 |
|
9 | test('transform symlink', { skip: process.platform === 'win32' }, function (t) {
|
10 | t.plan(4);
|
11 | var expected = [ 9, 555, 777 ];
|
12 | var b = browserify(__dirname + '/tr_symlink/app/main.js', {
|
13 | basedir: __dirname + '/tr_symlink/app'
|
14 | });
|
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 | });
|
21 | b.bundle(function (err, src) {
|
22 | t.ifError(err);
|
23 | var c = { console: { log: log } };
|
24 | vm.runInNewContext(src, c);
|
25 | function log (msg) { t.equal(msg, expected.shift()) }
|
26 | });
|
27 | });
|