forked from requirejs/requirejs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdepEmpty.html
40 lines (37 loc) · 1.16 KB
/
depEmpty.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
35
36
37
38
39
40
<!DOCTYPE html>
<html>
<head>
<title>require.js: Empty Dependency Test</title>
<script type="text/javascript" src="doh/runner.js"></script>
<script type="text/javascript" src="doh/_browserRunner.js"></script>
<script type="text/javascript" src="../require.js"></script>
<script>
var noneOk = false,
emptyOk = false;
define('none', function (require, exports, module) {
noneOk = arguments.length === 3;
});
define('empty', [], function () {
emptyOk = arguments.length === 0;
});
require(['none', 'empty'], function (none, empty) {
doh.register(
"depEmpty",
[
function depEmpty(t){
t.is(true, noneOk, 'none has three args');
t.is(true, emptyOk, 'empty has no args');
}
]
);
doh.run();
});
</script>
</head>
<body>
<h1>require.js: Empty Dependency Test</h1>
<p>If empty array passed, then do not pass any args to factory function.
<a href="https://github.com/requirejs/requirejs/issues/669">More info.</a></p>
<p>Check console for messages</p>
</body>
</html>