blob: 34bfd2857d85683bd1309557aafc74b49eb30278 [file] [log] [blame]
Rohan Patel6f7e46b2019-09-25 14:35:28 -04001/* 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
19import 'zone.js/dist/long-stack-trace-zone';
20import 'zone.js/dist/proxy.js';
21import 'zone.js/dist/sync-test';
22import 'zone.js/dist/jasmine-patch';
23import 'zone.js/dist/async-test';
24import 'zone.js/dist/fake-async-test';
25import { getTestBed } from '@angular/core/testing';
26import {
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.
32declare const __karma__: any;
33declare const require: any;
34
35// Prevent Karma from running prematurely.
36__karma__.loaded = function () {};
37
38// First, initialize the Angular testing environment.
39getTestBed().initTestEnvironment(
40 BrowserDynamicTestingModule,
41 platformBrowserDynamicTesting()
42);
43// Then we find all the tests.
44const context = require.context('./', true, /\.spec\.ts$/);
45// And load the modules.
46context.keys().map(context);
47// Finally, start Karma to run the tests.
48__karma__.start();