Revision 61399
Added by Konstantinos Triantafyllou over 2 years ago
test.ts | ||
---|---|---|
1 | 1 |
// This file is required by karma.conf.js and loads recursively all the .spec and framework files |
2 | 2 |
|
3 |
import 'zone.js/dist/long-stack-trace-zone'; |
|
4 |
import 'zone.js/dist/proxy.js'; |
|
5 |
import 'zone.js/dist/sync-test'; |
|
6 |
import 'zone.js/dist/jasmine-patch'; |
|
7 |
import 'zone.js/dist/async-test'; |
|
8 |
import 'zone.js/dist/fake-async-test'; |
|
3 |
import 'zone.js/dist/zone-testing'; |
|
9 | 4 |
import { getTestBed } from '@angular/core/testing'; |
10 | 5 |
import { |
11 | 6 |
BrowserDynamicTestingModule, |
12 | 7 |
platformBrowserDynamicTesting |
13 | 8 |
} from '@angular/platform-browser-dynamic/testing'; |
14 | 9 |
|
15 |
// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any. |
|
16 |
declare const __karma__: any; |
|
17 | 10 |
declare const require: any; |
18 | 11 |
|
19 |
// Prevent Karma from running prematurely. |
|
20 |
__karma__.loaded = function () {}; |
|
21 |
|
|
22 | 12 |
// First, initialize the Angular testing environment. |
23 | 13 |
getTestBed().initTestEnvironment( |
24 | 14 |
BrowserDynamicTestingModule, |
... | ... | |
28 | 18 |
const context = require.context('./', true, /\.spec\.ts$/); |
29 | 19 |
// And load the modules. |
30 | 20 |
context.keys().map(context); |
31 |
// Finally, start Karma to run the tests. |
|
32 |
__karma__.start(); |
Also available in: Unified diff
[Usage Counts | Trunk]: Update to angular 11