1 | var test = require('tap').test;
|
2 | var browserify = require('browserify');
|
3 |
|
4 | var vm = require('vm');
|
5 | var fs = require('fs');
|
6 | var path = require('path');
|
7 |
|
8 | var html = fs.readFileSync(__dirname + '/files/robot.html', 'utf8');
|
9 |
|
10 | test('path.join', function (t) {
|
11 | t.plan(1);
|
12 |
|
13 | var b = browserify();
|
14 | b.add(__dirname + '/files/path_join.js');
|
15 | b.transform(path.dirname(__dirname));
|
16 |
|
17 | b.bundle(function (err, src) {
|
18 | if (err) t.fail(err);
|
19 | vm.runInNewContext(src, { console: { log: log } });
|
20 | });
|
21 |
|
22 | function log (msg) {
|
23 | t.equal(html, msg);
|
24 | }
|
25 | });
|