~caneypuggies/reformedchurcheslocator/couchapp-backbone

« back to all changes in this revision

Viewing changes to _attachments/js/vendor/requirejs/tests/pathArray/pathArrayFail.html

  • Committer: Tim Black
  • Date: 2013-09-16 22:50:16 UTC
  • Revision ID: tim@alwaysreformed.com-20130916225016-zk8jiba25z33ew7h
Versioned Bower vendor directory

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE html>
 
2
<html>
 
3
<head>
 
4
    <title>require.js: Path Array Fail Test</title>
 
5
    <script type="text/javascript" src="../../require.js"></script>
 
6
    <script type="text/javascript" src="../doh/runner.js"></script>
 
7
    <script type="text/javascript" src="../doh/_browserRunner.js"></script>
 
8
    <script type="text/javascript">
 
9
        var master = new doh.Deferred(),
 
10
            threwError = false,
 
11
            counter = 0;
 
12
 
 
13
        function done() {
 
14
            counter += 1;
 
15
            doh.is(1, counter, "done should only be called once");
 
16
 
 
17
            if (counter === 1) {
 
18
                //Set a timeout that expires after waitSeconds to be sure
 
19
                //we are not called with a timeout error when enforceDefine
 
20
                //is in play.
 
21
                setTimeout(function () {
 
22
                    master.callback(true);
 
23
                }, 4500);
 
24
            }
 
25
        }
 
26
 
 
27
        requirejs.onError = function (err) {
 
28
            //console.log('onError: ' + err.requireModules[0] + ', type: ' + err.requireType);
 
29
            doh.is(true, err.requireType !== 'timeout', 'no timeout error');
 
30
            doh.is('dep', err.requireModules[0]);
 
31
            done();
 
32
        };
 
33
 
 
34
        requirejs({
 
35
            waitSeconds: 2,
 
36
            enforceDefine: true,
 
37
            paths: {
 
38
                'dep': [
 
39
                    'fake1',
 
40
                    'fake2'
 
41
                ]
 
42
            }
 
43
        }, ['dep'], function (dep) {
 
44
            doh.is("real", "shouldNotExist");
 
45
            done();
 
46
        });
 
47
 
 
48
        doh.register(
 
49
            "pathArray",
 
50
            [
 
51
                {
 
52
                    name: "pathArray",
 
53
                    timeout: 10000,
 
54
                    runTest: function () {
 
55
                        return master;
 
56
                    }
 
57
                }
 
58
            ]
 
59
        );
 
60
        doh.run();
 
61
    </script>
 
62
</head>
 
63
<body>
 
64
    <h1>require.js: Path Array Fail Test</h1>
 
65
 
 
66
    <p>Using an array for a path value to get retries, but fail on all the
 
67
    retries. For more info see
 
68
    <a href="https://github.com/jrburke/requirejs/issues/257">257</a></p>
 
69
 
 
70
    <p>Check console for messages</p>
 
71
</body>
 
72
</html>