forked from requirejs/requirejs
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes requirejs#142, './mod' not resolved to 'mod' when at top level
- Loading branch information
Showing
5 changed files
with
50 additions
and
0 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
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
//Use a property on require so if the test runs in node, it is visible. | ||
//Remove it when done with the test. | ||
require.relativeBaseUrlCounter = 0; | ||
|
||
require({ | ||
baseUrl: require.isBrowser ? "./" : "./relative/" | ||
}, | ||
["./top", "top"], | ||
function(top1, top2) { | ||
doh.register( | ||
"relativeBaseUrl", | ||
[ | ||
function relativeBaseUrl(t){ | ||
t.is(top1.id, top2.id); | ||
t.is(1, require.relativeBaseUrlCounter); | ||
|
||
delete require.relativeBaseUrlCounter; | ||
} | ||
] | ||
); | ||
|
||
doh.run(); | ||
} | ||
); |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>require.js: Relative Module Names at baseUrl Test</title> | ||
<script type="text/javascript" src="../../require.js"></script> | ||
<script type="text/javascript" src="../doh/runner.js"></script> | ||
<script type="text/javascript" src="../doh/_browserRunner.js"></script> | ||
<script type="text/javascript" src="relativeBaseUrl-tests.js"></script> | ||
</head> | ||
<body> | ||
<h1>require.js: Relative Module Names at baseUrl Test</h1> | ||
<p>Check console for messages</p> | ||
</body> | ||
</html> |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
define(function () { | ||
require.relativeBaseUrlCounter += 1; | ||
return { | ||
id: require.relativeBaseUrlCounter | ||
}; | ||
}); |