Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add test, and fix, exclusion of deep level deps.

  • Loading branch information...
commit b8640fdbf98c23a47e9155e4369ad78848347521 1 parent 348487b
Kenneth Kufluk authored
View
2  lib/loadbuilder/builder.js
@@ -71,7 +71,7 @@ util.extend(Builder.prototype, {
var excludes;
if (ex.assets) {
- excludes = ex.assets.map(function(dep) { return dep.id });
+ excludes = ex.collectedAssets().map(function(dep) { return dep.id });
} else {
excludes = [].slice.call(arguments);
}
View
2  package.json
@@ -1,6 +1,6 @@
{
"name": "loadbuilder",
- "version": "0.2.7",
+ "version": "0.2.8",
"description": "Combine and compress dependency chains created by Loadrunner",
"contributors": [{ "name": "Dan Webb", "email": "dan@danwebb.net" }, { "name": "Kenneth Kufluk", "email": "kenneth@kufluk.com" }],
"homepage": "https://github.com/danwrong/loadbuilder",
View
13 test/builder.js
@@ -58,10 +58,19 @@ module.exports = {
);
},
testShouldBeAbleToExcludeABundle: function() {
- var a = builder(opts).include('fixtures/dep1.js', 'fixtures/dep2.js');
+ var a = builder(opts).include('fixtures/dep1.js', 'fixtures/dep2.js'),
+ result = builder(opts).include('fixtures/has_dep.js').exclude(a).toSource();
assert.equal(
"using('fixtures/dep1.js', 'fixtures/dep2.js');",
- builder(opts).include('fixtures/has_dep.js').exclude(a).toSource()
+ result
+ );
+ },
+ testShouldBeAbleToExcludeADeepDep: function() {
+ var a = builder(opts).include('mod_with_dep'),
+ result = builder(opts).include('mod_with_same_dep').exclude(a).toSource();
+ assert.equal(
+ "provide(\"mod_with_same_dep\", function(exports) {\n using(\"named\", function() {\n exports(3);\n });\n});",
+ result
);
},
testShouldBeAbleToExcludeABundleWithoutBreakingCommonJS: function() {
View
5 test/modules/mod_with_same_dep.js
@@ -0,0 +1,5 @@
+provide(function(exports) {
+ using('named', function() {
+ exports(3);
+ });
+});
Please sign in to comment.
Something went wrong with that request. Please try again.