-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlibrarySystem.html
More file actions
70 lines (55 loc) · 1.57 KB
/
Copy pathlibrarySystem.html
File metadata and controls
70 lines (55 loc) · 1.57 KB
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
<html>
<body>
</body>
</html>
<script src="tinytest.js"></script>
<script src="librarySystem.js"></script>
<script>
tests({
'should accept a library module': function() {
librarySystem('app', [] , function() {
return 'this is the app module';
});
eq(librarySystem('app') === 'this is the app module', true);
libReset();
},
'library should accept a dependency': function() {
librarySystem('router', [], function() {
return 'hello router';
})
librarySystem('app', ['router'], function(router) {
return {
router: router
}
});
eq(librarySystem('app').router === 'hello router', true);
libReset();
},
'library should accept multiple dependencies': function() {
librarySystem('name', [], function() {;
return 'Gordon';
});
librarySystem('company', [], function() {
return 'watchandcode';
});
librarySystem('workBlurb', ['name', 'company'], function(name, company) {
return name + ' works at ' + company;
});
eq(librarySystem('workBlurb') === 'Gordon works at watchandcode', true);
libReset();
},
'library should accept dependencies out of order': function() {
librarySystem('workBlurb', ['name', 'company'], function(name, company) {
return name + ' works at ' + company;
});
librarySystem('name', [], function() {
return 'Gordon';
});
librarySystem('company', [], function() {
return 'watchandcode';
});
eq(librarySystem('workBlurb') === 'Gordon works at watchandcode', true);
libReset();
}
});
</script>