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