Rohan Patel | 6f7e46b | 2019-09-25 14:35:28 -0400 | [diff] [blame] | 1 | /* Copyright (c) 2019 AT&T Intellectual Property. #
|
| 2 | # #
|
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); #
|
| 4 | # you may not use this file except in compliance with the License. #
|
| 5 | # You may obtain a copy of the License at #
|
| 6 | # #
|
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 #
|
| 8 | # #
|
| 9 | # Unless required by applicable law or agreed to in writing, software #
|
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, #
|
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
|
| 12 | # See the License for the specific language governing permissions and #
|
| 13 | # limitations under the License. #
|
| 14 | ##############################################################################*/
|
| 15 |
|
| 16 |
|
| 17 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
| 18 |
|
| 19 | import 'zone.js/dist/long-stack-trace-zone';
|
| 20 | import 'zone.js/dist/proxy.js';
|
| 21 | import 'zone.js/dist/sync-test';
|
| 22 | import 'zone.js/dist/jasmine-patch';
|
| 23 | import 'zone.js/dist/async-test';
|
| 24 | import 'zone.js/dist/fake-async-test';
|
| 25 | import { getTestBed } from '@angular/core/testing';
|
| 26 | import {
|
| 27 | BrowserDynamicTestingModule,
|
| 28 | platformBrowserDynamicTesting
|
| 29 | } from '@angular/platform-browser-dynamic/testing';
|
| 30 |
|
| 31 | // Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
|
| 32 | declare const __karma__: any;
|
| 33 | declare const require: any;
|
| 34 |
|
| 35 | // Prevent Karma from running prematurely.
|
| 36 | __karma__.loaded = function () {};
|
| 37 |
|
| 38 | // First, initialize the Angular testing environment.
|
| 39 | getTestBed().initTestEnvironment(
|
| 40 | BrowserDynamicTestingModule,
|
| 41 | platformBrowserDynamicTesting()
|
| 42 | );
|
| 43 | // Then we find all the tests.
|
| 44 | const context = require.context('./', true, /\.spec\.ts$/);
|
| 45 | // And load the modules.
|
| 46 | context.keys().map(context);
|
| 47 | // Finally, start Karma to run the tests.
|
| 48 | __karma__.start();
|