-
Notifications
You must be signed in to change notification settings - Fork 522
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1320 from stealjs/buildconfig
Prevents buildConfig from overriding package's configuration
- Loading branch information
Showing
2 changed files
with
41 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -876,3 +876,43 @@ QUnit.test("'map' configuration where the right-hand identifier is an npm packag | |
.then(done, helpers.fail(assert, done)); | ||
}); | ||
|
||
QUnit.test("buildConfig that is late-loaded doesn't override outer config", function(assert){ | ||
var done = assert.async(); | ||
|
||
var loader = helpers.clone() | ||
.rootPackage({ | ||
name: "app", | ||
main: "main.js", | ||
version: "1.0.0", | ||
dependencies: { | ||
dep: "1.0.0" | ||
}, | ||
steal: { | ||
map: { | ||
"app/one": "app/two" | ||
}, | ||
buildConfig: { | ||
map: { | ||
"app/one": "dep" | ||
} | ||
} | ||
} | ||
}) | ||
.withPackages([ | ||
{ | ||
name: "dep", | ||
main: "main.js", | ||
version: "1.0.0" | ||
} | ||
]) | ||
.loader; | ||
|
||
helpers.init(loader).then(function(){ | ||
loader.npmContext.resavePackageInfo = true; | ||
return loader.normalize("dep", "[email protected]#main"); | ||
}).then(function(){ | ||
var pkg = loader.npmContext.pkgInfo[0]; | ||
assert.equal(pkg.steal.map["[email protected]#one"], "[email protected]#two", "Correct mapping in place"); | ||
}) | ||
.then(done, helpers.fail(assert, done)); | ||
}); |