1/* 2 * Copyright (C) 2022 The Android Open Source Project 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 17// organize-imports-ignore 18import 'common/global_init'; 19import {globalConfig} from './common/global_config'; 20globalConfig.set({ 21 MODE: 'KARMA_TEST', 22}); 23 24import 'zone.js'; 25import 'zone.js/testing'; 26import {TestBed} from '@angular/core/testing'; 27import { 28 BrowserDynamicTestingModule, 29 platformBrowserDynamicTesting, 30} from '@angular/platform-browser-dynamic/testing'; 31 32declare const require: { 33 context( 34 path: string, 35 deep?: boolean, 36 filter?: RegExp, 37 ): { 38 <T>(id: string): T; 39 keys(): string[]; 40 }; 41}; 42 43TestBed.initTestEnvironment( 44 BrowserDynamicTestingModule, 45 platformBrowserDynamicTesting(), 46); 47 48// filter matches all "*_test.ts" files that are not within the /test/e2e/ directory 49const context = require.context('./', true, /(?<!\/test\/e2e\/.*)_test.ts$/); 50context.keys().forEach(context); 51