web-apps/vendor/requirejs/tests/relative/relativeBaseUrl-tests.js
Maxim Kadushkin 741b10515d webapps added
2016-03-10 21:48:53 -03:00

25 lines
621 B
JavaScript

//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();
}
);