Fix Bug 2121: NG-UI uses unmaintained Chokidar version
[osm/NG-UI.git] / src / test.ts
1 /*
2  Copyright 2020 TATA ELXSI
3
4  Licensed under the Apache License, Version 2.0 (the 'License');
5  you may not use this file except in compliance with the License.
6  You may obtain a copy of the License at
7
8     http://www.apache.org/licenses/LICENSE-2.0
9
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15
16  Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.in), BARATH KUMAR R (barath.r@tataelxsi.co.in)
17  */
18 /**
19  * @file This file is required by karma.conf.js and loads recursively all the .spec and framework files.
20  */
21 import { getTestBed } from '@angular/core/testing';
22 import {
23     BrowserDynamicTestingModule,
24     platformBrowserDynamicTesting
25 } from '@angular/platform-browser-dynamic/testing';
26 import 'zone.js/dist/zone-testing';
27
28 /** const variable require */
29 // eslint-disable-next-line @typescript-eslint/no-explicit-any
30 declare const require: any;
31
32 // First, initialize the Angular testing environment.
33 getTestBed().initTestEnvironment(
34     BrowserDynamicTestingModule,
35     platformBrowserDynamicTesting(), {
36     teardown: { destroyAfterEach: false }
37 }
38 );
39
40 /** const variable context */
41 // Then we find all the tests.
42 const context = require.context('./', true, /\.spec\.ts$/);
43 // And load the modules.
44 context.keys().map(context);