3.0 source code
This commit is contained in:
1
OfficeWeb/vendor/requirejs/tests/toUrl/.hidden.html
vendored
Normal file
1
OfficeWeb/vendor/requirejs/tests/toUrl/.hidden.html
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.hidden
|
||||
1
OfficeWeb/vendor/requirejs/tests/toUrl/auxil.html
vendored
Normal file
1
OfficeWeb/vendor/requirejs/tests/toUrl/auxil.html
vendored
Normal file
@@ -0,0 +1 @@
|
||||
aux
|
||||
1
OfficeWeb/vendor/requirejs/tests/toUrl/main.html
vendored
Normal file
1
OfficeWeb/vendor/requirejs/tests/toUrl/main.html
vendored
Normal file
@@ -0,0 +1 @@
|
||||
main.html
|
||||
8
OfficeWeb/vendor/requirejs/tests/toUrl/main.js
vendored
Normal file
8
OfficeWeb/vendor/requirejs/tests/toUrl/main.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
define(function (require) {
|
||||
return {
|
||||
html: require('text!./main.html'),
|
||||
noext: require('text!sub/noext'),
|
||||
hidden: require('text!.hidden.html'),
|
||||
util: require('sub/util')
|
||||
};
|
||||
});
|
||||
7
OfficeWeb/vendor/requirejs/tests/toUrl/sub/nested/thing.js
vendored
Normal file
7
OfficeWeb/vendor/requirejs/tests/toUrl/sub/nested/thing.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
define(function (require) {
|
||||
return {
|
||||
noext: require('text!../noext'),
|
||||
dirPath: require.toUrl('.'),
|
||||
parentPath: require.toUrl('..')
|
||||
};
|
||||
});
|
||||
1
OfficeWeb/vendor/requirejs/tests/toUrl/sub/noext
vendored
Normal file
1
OfficeWeb/vendor/requirejs/tests/toUrl/sub/noext
vendored
Normal file
@@ -0,0 +1 @@
|
||||
noext
|
||||
1
OfficeWeb/vendor/requirejs/tests/toUrl/sub/util.html
vendored
Normal file
1
OfficeWeb/vendor/requirejs/tests/toUrl/sub/util.html
vendored
Normal file
@@ -0,0 +1 @@
|
||||
util
|
||||
8
OfficeWeb/vendor/requirejs/tests/toUrl/sub/util.js
vendored
Normal file
8
OfficeWeb/vendor/requirejs/tests/toUrl/sub/util.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
define(function (require) {
|
||||
return {
|
||||
dotPath: require.toUrl('.'),
|
||||
html: require('text!./util.html'),
|
||||
auxHtml: require('text!../auxil.html'),
|
||||
thing: require('./nested/thing')
|
||||
};
|
||||
});
|
||||
30
OfficeWeb/vendor/requirejs/tests/toUrl/toUrl-tests.js
vendored
Normal file
30
OfficeWeb/vendor/requirejs/tests/toUrl/toUrl-tests.js
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
require.config({
|
||||
paths: {
|
||||
text: '../../../text/text'
|
||||
}
|
||||
});
|
||||
|
||||
require(['main'], function(main) {
|
||||
|
||||
var subRegExp = /\/sub$/,
|
||||
nestedRegExp = /\/sub\/nested$/;
|
||||
|
||||
doh.register(
|
||||
"toUrl",
|
||||
[
|
||||
function toUrl(t){
|
||||
t.is(".hidden", main.hidden);
|
||||
t.is("main.html", main.html);
|
||||
t.is("noext", main.noext);
|
||||
t.is("aux", main.util.auxHtml);
|
||||
t.is(true, subRegExp.test(main.util.dotPath));
|
||||
t.is("util", main.util.html);
|
||||
|
||||
t.is(true, nestedRegExp.test(main.util.thing.dirPath));
|
||||
t.is(true, subRegExp.test(main.util.thing.parentPath));
|
||||
t.is("noext", main.util.thing.noext);
|
||||
}
|
||||
]
|
||||
);
|
||||
doh.run();
|
||||
});
|
||||
14
OfficeWeb/vendor/requirejs/tests/toUrl/toUrl.html
vendored
Normal file
14
OfficeWeb/vendor/requirejs/tests/toUrl/toUrl.html
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>require.js: toUrl Test</title>
|
||||
<script src="../doh/runner.js"></script>
|
||||
<script src="../doh/_browserRunner.js"></script>
|
||||
<script src="../../require.js"></script>
|
||||
<script src="toUrl-tests.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>require.js: toUrl Test</h1>
|
||||
<p>Check console for messages</p>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user