Skip to content

Commit

Permalink
Merge pull request #30 from austinpray/vendorTests
Browse files Browse the repository at this point in the history
Adds more tests to confirm vendor order
  • Loading branch information
austinpray committed Mar 23, 2015
2 parents e0e1822 + e8b0d68 commit a907469
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/test.js
Expand Up @@ -76,6 +76,10 @@ describe('Dependency', function () {
});
var depBare = new Dependency('app.css', {
});
var depVendor = new Dependency('app.js', {
vendor: ['assets/vendor1.js', 'assets/vendor2.js'],
files: ['firstparty1.js', 'firstparty2.js']
});
it('should set properties correctly', function () {
assert.equal(dep.type, 'js');
assert.equal(depBare.type, 'css');
Expand All @@ -85,6 +89,14 @@ describe('Dependency', function () {
]);
assert.sameMembers(depBare.globs, []);
});
it('should put globs in order', function () {
assert.equal(dep.globs[0], 'test.js');
assert.equal(dep.globs[1], 'test1.js');
assert.equal(depVendor.globs[0], 'assets/vendor1.js');
assert.equal(depVendor.globs[1], 'assets/vendor2.js');
assert.equal(depVendor.globs[2], 'firstparty1.js');
assert.equal(depVendor.globs[3], 'firstparty2.js');
});
it('should prependGlobs correctly', function () {
dep.prependGlobs('new.js');
assert.sameMembers(dep.globs, [
Expand Down Expand Up @@ -367,6 +379,9 @@ describe('Integration Tests', function () {
'assets/scripts/somescript.js'
]);

assert.equal(_.find(globs.js, { name: 'vendor.js' }).globs[0], '../../plugin/script.js');
assert.equal(_.find(globs.js, { name: 'vendor.js' }).globs[1], 'assets/scripts/somescript.js');

});
});
});
Expand Down

0 comments on commit a907469

Please sign in to comment.