web-apps/vendor/requirejs/tests/relative/relativeBaseUrl-tests.js

25 lines
621 B
JavaScript
Raw Normal View History

2016-03-11 00:48:53 +00:00
//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: requirejs.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();
}
);