forked from WilcoFiers/UseYUI-for-RequireJS
/
test.html
34 lines (30 loc) · 1.32 KB
/
test.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!DOCTYPE html>
<html>
<body>
<script src="http://yuim.in/"></script>
<script src="require-0.27.1.js"></script>
<script>
console.log('there are 5 tests');
require(['YUI!dd,anim', 'YUI!cookie'], function (A, B, C) {
var a = new A.Anim();
console.log("Test 1: " + (typeof A.Anim !== 'undefined' ? 'passed' : 'failed' ));
console.log("Test 2: " + (typeof A.Cookie === 'undefined' ? 'passed' : 'failed' ));
// console.log(A);
console.log("Test 3: " + (typeof B.Cookie !== 'undefined' ? 'passed' : 'failed' ));
console.log(C); //undefined
}
);
require(['YUI!yql'], function (Y) {
console.log("Test 4: " + (typeof Y.YQL !== 'undefined' ? 'passed' : 'failed' ));
});
require({YUI : { src : 'yui-min-341.js'}}, ['YUI!cookie'], function (Y) {
console.log("Test 5: " + (typeof Y.Cookie !== 'undefined' ? 'passed' : 'failed' ));
console.log("Test 6: " + (typeof Y.YQL === 'undefined' ? 'passed' : 'failed' ));
console.log(Y);
});
require(['YUI!foobar'], function (Y) {
//This will throw 'NOT loaded' warnings in the console.
});
</script>
</body>
</html>