Debian Codegraph @

tests/defineDouble/defineDouble.html

raw
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>almond: Define Double Test</title>
5 <script src="../doh/runner.js"></script>
6 <script src="../doh/_browserRunner.js"></script>
7 <script src="../../almond.js"></script>
8 <script>
9 var aCount = 0,
10 bCount = 0;
11
12 define('a', function () {
13 aCount += 1;
14 });
15 define('a', function () {
16 aCount += 1;
17 });
18
19 define('b', function() {
20 bCount += 1;
21 });
22
23 require(['b'], function() {
24
25 define('b', function() {
26 bCount += 1;
27 });
28
29 require(['a', 'b'], function () {
30 doh.register(
31 'defineDouble',
32 [
33 function defineDouble(t){
34 t.is(1, aCount);
35 t.is(1, bCount);
36 }
37 ]
38 );
39 doh.run();
40 });
41 });
42 </script>
43 </head>
44 <body>
45 <h1>almond: Define Double Test</h1>
46 <p>Make sure a double define only uses the first one.
47 <a href="https://github.com/requirejs/almond/issues/43">More info</a></p>
48 <p>Check console for messages</p>
49 </body>
50 </html>