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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<html>
<head>
<title>YUI Use Tests</title>
</head>
<body class="yui3-skin-sam">
<h1>Namespace Tests</h1>
<p><input type="button" value="Run Tests" id="btnRun" disabled="true" /></p>
<script type="text/javascript">
(function() {
YUI({
logExclude: {Dom: true, Selector: true, Node: true, attribute: true, base: true, event: true, widget: true}
}).use("test", function(Y) {
var count = 0, testUse;
YUI().use("*", function(Y2) {
Y.log('Use * entry');
count++;
testUse = new Y2.Test.Case({
name: "Usestar tests",
test_use_star: function () {
// Loader should not have been pulled in if dependencies are right
}
});
});
YUI({
bootstrap: false
}).use("test", "blahblah", function(Y3) {
// Y.log('Use missing');
count++;
testUse = new Y.Test.Case({
name: "Usestar tests",
test_missing_message: function () {
}
});
});
Y.Test.Runner.add(testUse);
testRan = new Y.Test.Case({
name: "ran tests",
test_ran: function () {
// tests to make sure the use('*') callback executed
Y.Assert.areEqual(2, count);
}
});
Y.Test.Runner.add(testRan);
});
})();
</script>
</body>
</html>