1
|
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
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';
|
9
|
import { getTestBed } from '@angular/core/testing';
|
10
|
import {
|
11
|
BrowserDynamicTestingModule,
|
12
|
platformBrowserDynamicTesting
|
13
|
} from '@angular/platform-browser-dynamic/testing';
|
14
|
|
15
|
// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
|
16
|
declare const __karma__: any;
|
17
|
declare const require: any;
|
18
|
|
19
|
// Prevent Karma from running prematurely.
|
20
|
__karma__.loaded = function () {};
|
21
|
|
22
|
// First, initialize the Angular testing environment.
|
23
|
getTestBed().initTestEnvironment(
|
24
|
BrowserDynamicTestingModule,
|
25
|
platformBrowserDynamicTesting()
|
26
|
);
|
27
|
// Then we find all the tests.
|
28
|
const context = require.context('./', true, /\.spec\.ts$/);
|
29
|
// And load the modules.
|
30
|
context.keys().map(context);
|
31
|
// Finally, start Karma to run the tests.
|
32
|
__karma__.start();
|