Mercurial > hg > ugly-duckling
annotate src/test.ts @ 357:b529a08ddff1
Explicitly state the change detection strategy, despite the fact it will already be OnPush here because its parent is.
author | Lucas Thompson <dev@lucas.im> |
---|---|
date | Fri, 26 May 2017 18:30:58 +0100 |
parents | 53ea6406d601 |
children |
rev | line source |
---|---|
dev@236 | 1 // This file is required by karma.conf.js and loads recursively all the .spec and framework files |
dev@236 | 2 import 'polyfills'; |
angular-cli@0 | 3 import 'zone.js/dist/long-stack-trace-zone'; |
angular-cli@0 | 4 import 'zone.js/dist/proxy.js'; |
angular-cli@0 | 5 import 'zone.js/dist/sync-test'; |
angular-cli@0 | 6 import 'zone.js/dist/jasmine-patch'; |
angular-cli@0 | 7 import 'zone.js/dist/async-test'; |
angular-cli@0 | 8 import 'zone.js/dist/fake-async-test'; |
dev@25 | 9 import { getTestBed } from '@angular/core/testing'; |
dev@25 | 10 import { |
dev@25 | 11 BrowserDynamicTestingModule, |
dev@25 | 12 platformBrowserDynamicTesting |
dev@25 | 13 } from '@angular/platform-browser-dynamic/testing'; |
dev@236 | 14 import {UglyMaterialModule} from './app/ugly-material.module'; |
angular-cli@0 | 15 |
angular-cli@0 | 16 // Unfortunately there's no typing for the `__karma__` variable. Just declare it as any. |
angular-cli@0 | 17 declare var __karma__: any; |
angular-cli@0 | 18 declare var require: any; |
angular-cli@0 | 19 |
angular-cli@0 | 20 // Prevent Karma from running prematurely. |
angular-cli@0 | 21 __karma__.loaded = function () {}; |
angular-cli@0 | 22 |
dev@25 | 23 // First, initialize the Angular testing environment. |
dev@25 | 24 getTestBed().initTestEnvironment( |
dev@236 | 25 [ |
dev@236 | 26 BrowserDynamicTestingModule, |
dev@236 | 27 UglyMaterialModule |
dev@236 | 28 ], |
dev@25 | 29 platformBrowserDynamicTesting() |
dev@25 | 30 ); |
dev@25 | 31 // Then we find all the tests. |
dev@236 | 32 const context = require.context('./', true, /\.spec\.ts$/); |
dev@25 | 33 // And load the modules. |
dev@25 | 34 context.keys().map(context); |
dev@25 | 35 // Finally, start Karma to run the tests. |
dev@25 | 36 __karma__.start(); |