UNPKG

1.1 kBPlain TextView Raw
1import './polyfills.ts';
2
3import 'zone.js/dist/long-stack-trace-zone';
4import 'zone.js/dist/proxy.js';
5import 'zone.js/dist/sync-test';
6import 'zone.js/dist/jasmine-patch';
7import 'zone.js/dist/async-test';
8import 'zone.js/dist/fake-async-test';
9
10// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
11declare var __karma__: any;
12declare var require: any;
13
14// Prevent Karma from running prematurely.
15__karma__.loaded = function () {};
16
17
18Promise.all([
19 System.import('@angular/core/testing'),
20 System.import('@angular/platform-browser-dynamic/testing')
21])
22 // First, initialize the Angular testing environment.
23 .then(([testing, testingBrowser]) => {
24 testing.getTestBed().initTestEnvironment(
25 testingBrowser.BrowserDynamicTestingModule,
26 testingBrowser.platformBrowserDynamicTesting()
27 );
28 })
29 // Then we find all the tests.
30 .then(() => require.context('./', true, /\.spec\.ts/))
31 // And load the modules.
32 .then(context => context.keys().map(context))
33 // Finally, start Karma to run the tests.
34 .then(__karma__.start, __karma__.error);