angular-cn/public/docs/_examples/testing/ts/unit-tests-5.html

42 lines
1.4 KiB
HTML

<!-- #docregion -->
<!DOCTYPE html>
<html>
<head>
<title>Ng App Unit Tests</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles.css">
<link rel="stylesheet" href="../node_modules/jasmine-core/lib/jasmine-core/jasmine.css">
<script src="node_modules/jasmine-core/lib/jasmine-core/jasmine.js"></script>
<script src="node_modules/jasmine-core/lib/jasmine-core/jasmine-html.js"></script>
<script src="node_modules/jasmine-core/lib/jasmine-core/boot.js"></script>
<!-- #docregion import-angular -->
<!-- #1. add the system.js and angular libraries -->
<script src="node_modules/zone.js/dist/zone.js"></script>
<script src="node_modules/reflect-metadata/Reflect.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>
<script src="systemjs.config.js"></script>
<!-- #enddocregion import-angular -->
<script>
// #2. Import the spec files explicitly
Promise.all([
System.import('app/hero.spec'),
System.import('app/my-uppercase.pipe.spec')
])
// #3. wait for all imports to load ...
// then re-execute `window.onload` which
// triggers the Jasmine test-runner start
// or explain what went wrong.
.then(window.onload)
.catch(console.error.bind(console));
</script>
</head>
<body></body>
</html>