systemjs/test/test-tracer.html
2017-01-23 10:38:15 +02:00

76 lines
2.0 KiB
HTML

<!doctype html>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="../node_modules/mocha/mocha.css"/>
<script src="../node_modules/mocha/mocha.js"></script>
<script src="../dist/system.src.js" type="text/javascript"></script>
<div id="mocha"></div>
<script>
mocha.setup('tdd');
SystemJS.config({
traceurOptions: {
asyncFunctions: true
},
warnings: true,
map: {
'plugin-traceur': '../node_modules/systemjs-plugin-traceur/plugin-traceur.js',
'traceur': '../node_modules/traceur/bin/traceur.js'
},
meta: {
'traceur': {
format: 'global',
exports: 'traceur',
scriptLoad: false
}
},
transpiler: 'plugin-traceur'
});
// enable tracing
System.trace = true;
suite('SystemJS tracing tests', function () {
function ok(assertion, message) {
if (!assertion)
throw new Error(messasge);
}
test('ES6 Circular', function () {
return System.import('tests/es6-circular1.js')
.then(function (m) {
ok(System.loads[System.normalizeSync('tests/es6-circular1.js')].deps[0] == './es6-circular2.js');
});
});
test('AMD & CJS circular, ES6 Circular', function () {
return System.import('tests/all-circular1.js')
.then(function (m) {
ok(System.loads[System.normalizeSync('tests/all-circular1.js')].deps[0] == './all-circular2.js');
});
});
test('AMD -> System.register circular -> ES6', function () {
return System.import('tests/all-layers1.js')
.then(function (m) {
ok(System.loads[System.normalizeSync('tests/all-layers1.js')].deps[0] == './all-layers2.js');
});
});
test('Advanced compiler plugin', function () {
return System.import('tests/compiler-test.coffee!tests/advanced-plugin.js')
.then(function (m) {
ok(true);
});
});
});
mocha.run();
</script>