Skip to content

Commit

Permalink
failing array add() test
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Sep 19, 2014
1 parent 9816db5 commit 2de778e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/array.js
@@ -0,0 +1,22 @@
var browserify = require('../');
var vm = require('vm');
var test = require('tap').test;

test('array add', function (t) {
var expected = [ 'ONE', 'TWO', 'THREE' ];
t.plan(expected.length);

var b = browserify();
var files = [
__dirname + '/array/one.js',
__dirname + '/array/two.js',
__dirname + '/array/three.js'
];
b.add(files);
b.bundle(function (err, src) {
vm.runInNewContext(src, { console: { log: log } });
function log (msg) {
t.equal(msg, expected.shift());
}
});
});
1 change: 1 addition & 0 deletions test/array/one.js
@@ -0,0 +1 @@
console.log('ONE');
1 change: 1 addition & 0 deletions test/array/three.js
@@ -0,0 +1 @@
console.log('THREE');
1 change: 1 addition & 0 deletions test/array/two.js
@@ -0,0 +1 @@
console.log('TWO');

0 comments on commit 2de778e

Please sign in to comment.