aboutsummaryrefslogtreecommitdiff
path: root/thirdparty/systemjs/test/test-tracer.html
blob: 52075004fc6df2cf86023a2e92456f2456295235 (plain)
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
71
<!doctype html>
<html>
  <head>
    <link rel="stylesheet" type="text/css" href="../bower_components/qunit/qunit/qunit.css"/>
  </head>
  <body>

    <h1 id="qunit-header">SystemJS Test Suite</h1>

    <h2 id="qunit-banner"></h2>
    <div id="qunit-testrunner-toolbar"></div>
    <h2 id="qunit-userAgent"></h2>
    <ol id="qunit-tests"></ol>
    <div id="qunit-test-area"></div>

    <script src="../dist/system.src.js" type="text/javascript"></script>

    <script src="../bower_components/qunit/qunit/qunit.js"></script>

    <script>
      System.paths.traceur = '../node_modules/traceur/bin/traceur.js';

      QUnit.config.testTimeout = 2000;

      QUnit.module("SystemJS Tracer");

      function err(e) {
        setTimeout(function() {
          throw e.stack || e;
          start();
        });  
      }

      // enable tracing
      System.pluginLoader = new System.constructor();
      System.pluginLoader.paths = System.paths;
      System.pluginLoader.baseURL = System.baseURL;
      System.trace = true;
      // System.execute = false;

      asyncTest('ES6 Circular', function() {
        System['import']('tests/es6-circular1.js').then(function(m) {
          ok(System.loads[System.normalizeSync('tests/es6-circular1.js')].deps[0] == './es6-circular2.js');
          start();
        }, err);
      });

      asyncTest('AMD & CJS circular, ES6 Circular', function() {
        System['import']('tests/all-circular1.js').then(function(m) {
          ok(System.loads[System.normalizeSync('tests/all-circular1.js')].deps[0] == './all-circular2.js');
          start();
        }, err);
      });

      asyncTest('AMD -> System.register circular -> ES6', function() {
        System['import']('tests/all-layers1.js').then(function(m) {
          ok(System.loads[System.normalizeSync('tests/all-layers1.js')].deps[0] == './all-layers2.js');
          start();
        }, err);
      });

      asyncTest('Advanced compiler plugin', function() {
        System['import']('tests/compiler-test.coffee!tests/advanced-plugin.js').then(function(m) {
          ok(true);
          start();
        }, err);
      });

    </script>
  </body>
</html>