-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make sure entry paths are always full paths
- Loading branch information
Showing
5 changed files
with
91 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
var browserify = require('../'); | ||
var vm = require('vm'); | ||
var test = require('tap').test; | ||
|
||
test('entry - relative path', function (t) { | ||
t.plan(3); | ||
|
||
var b = browserify('entry/main.js'); | ||
b.on('dep', function(row) { | ||
if (row.entry) t.equal(row.file, __dirname + '/entry/main.js'); | ||
}); | ||
b.bundle(function (err, src) { | ||
var c = { | ||
done : function (one, two) { | ||
t.equal(one, 1); | ||
t.equal(two, 2); | ||
t.end(); | ||
} | ||
}; | ||
vm.runInNewContext(src, c); | ||
}); | ||
}); | ||
|
||
test('entry - relative path via add', function (t) { | ||
t.plan(3); | ||
|
||
var b = browserify({basedir: __dirname}); | ||
b.add('entry/main.js'); | ||
b.on('dep', function(row) { | ||
if (row.entry) t.equal(row.file, __dirname + '/entry/main.js'); | ||
}); | ||
b.bundle(function (err, src) { | ||
var c = { | ||
done : function (one, two) { | ||
t.equal(one, 1); | ||
t.equal(two, 2); | ||
t.end(); | ||
} | ||
}; | ||
vm.runInNewContext(src, c); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters