3 * Copyright Akveo. All Rights Reserved.
4 * Licensed under the MIT License. See License.txt in the project root for license information.
7 // This file is required by karma.conf.js and loads recursively all the .spec and framework files
9 import 'zone.js/dist/long-stack-trace-zone';
10 import 'zone.js/dist/proxy.js';
11 import 'zone.js/dist/sync-test';
12 import 'zone.js/dist/jasmine-patch';
13 import 'zone.js/dist/async-test';
14 import 'zone.js/dist/fake-async-test';
15 import { getTestBed } from '@angular/core/testing';
17 BrowserDynamicTestingModule,
18 platformBrowserDynamicTesting,
19 } from '@angular/platform-browser-dynamic/testing';
21 // Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
22 declare const __karma__: any;
23 declare const require: any;
25 // Prevent Karma from running prematurely.
26 __karma__.loaded = function () {};
28 // First, initialize the Angular testing environment.
29 getTestBed().initTestEnvironment(
30 BrowserDynamicTestingModule,
31 platformBrowserDynamicTesting(),
33 // Then we find all the tests.
34 const context = require.context('./', true, /\.spec\.ts$/);
35 // And load the modules.
36 context.keys().map(context);
37 // Finally, start Karma to run the tests.