-
Notifications
You must be signed in to change notification settings - Fork 521
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 #1491 from stealjs/res-mod
Prevent running normalization on already normalized npm names
- Loading branch information
Showing
4 changed files
with
55 additions
and
13 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
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -532,6 +532,41 @@ QUnit.test("Imports git+ssh URLs that contain a hash", function(assert) { | |
.then(done, helpers.fail(assert, done)); | ||
}); | ||
|
||
QUnit.test("Can load a module loading an exact version of an npm module", function(assert) { | ||
var done = assert.async(); | ||
|
||
var loader = helpers.clone() | ||
.rootPackage({ | ||
name: "app", | ||
main: "main.js", | ||
version: "1.0.0", | ||
dependencies: { | ||
"debug": "3.0.0" | ||
} | ||
}) | ||
.withPackages([ | ||
{ | ||
name: "dep", | ||
main: "main.js", | ||
version: "1.0.0", | ||
dependencies: { | ||
"debug": "2.0.0" | ||
} | ||
} | ||
]) | ||
.withModule("[email protected]#index", "module.exports='works';") | ||
.withModule("[email protected]#main", "module.exports=require('[email protected]#index');") | ||
.loader; | ||
|
||
helpers.init(loader).then(function(){ | ||
return loader["import"]("app"); | ||
}) | ||
.then(function(mod){ | ||
assert.equal(mod, "works", "It worked!"); | ||
}) | ||
.then(done, helpers.fail(assert, done)); | ||
}); | ||
|
||
QUnit.module("Error messages and warnings"); | ||
|
||
QUnit.test("importing a package with an unsaved dependency", function(assert) { | ||
|
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