File: index.html

package info (click to toggle)
node-platform 1.3.6-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 316 kB
  • sloc: javascript: 3,485; sh: 19; makefile: 2
file content (70 lines) | stat: -rw-r--r-- 1,877 bytes parent folder | download | duplicates (3)
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
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Platform.js Test Suite</title>
    <link rel="stylesheet" href="../node_modules/qunitjs/qunit/qunit.css">
  </head>
  <body>
    <div id="qunit"></div>
    <script src="../platform.js"></script>
    <script src="../node_modules/qunitjs/qunit/qunit.js"></script>
    <script>
      QUnit.config.hidepassed = true;
      QUnit.urlParams.norequire = /[?&]norequire=true(?:&|$)/.test(location.search);

      // load test.js if not using require.js
      document.write(QUnit.urlParams.norequire
        ? '<script src="test.js"><\/script>'
        : '<script src="../node_modules/requirejs/require.js"><\/script>'
      );
    </script>
    <script>
      var platformModule;

      (function() {
        if (!window.require) {
          return;
        }
        QUnit.config.autostart = false;

        requirejs.config({
          'baseUrl': './',
          'urlArgs': 't=' + (+new Date),
          'waitSeconds': 0,
          'packages': [
            {
              'name': 'platform',
              'location': '..',
              'main': 'platform'
            },
            {
              'name': 'test',
              'location': '.',
              'main': 'test'
            }
          ]
        });

        // load platform as a module
        require(['platform'], function(platform) {
          platformModule = platform;
          require(['test'], function() {
            QUnit.start();
          });
        });
      }());

      // set a more readable browser name
      window.onload = function() {
        var timeoutId = setInterval(function() {
          var ua = document.getElementById('qunit-userAgent');
          if (ua) {
            ua.innerHTML = platform;
            clearInterval(timeoutId);
          }
        }, 16);
      };
    </script>
  </body>
</html>