31 lines
761 B
TypeScript
Raw Normal View History

2022-06-17 10:48:15 +10:00
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
2022-12-09 16:59:11 +05:30
import "zone.js/testing";
import { getTestBed } from "@angular/core/testing";
2022-06-17 10:48:15 +10:00
import {
BrowserDynamicTestingModule,
2022-12-09 16:59:11 +05:30
platformBrowserDynamicTesting,
} from "@angular/platform-browser-dynamic/testing";
2022-06-17 10:48:15 +10:00
declare const require: {
2022-12-09 16:59:11 +05:30
context(
path: string,
deep?: boolean,
filter?: RegExp
): {
2022-06-17 10:48:15 +10:00
<T>(id: string): T;
keys(): string[];
};
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
2022-12-09 16:59:11 +05:30
platformBrowserDynamicTesting()
2022-06-17 10:48:15 +10:00
);
// Then we find all the tests.
2022-12-09 16:59:11 +05:30
const context = require.context("./", true, /\.spec\.ts$/);
2022-06-17 10:48:15 +10:00
// And load the modules.
context.keys().map(context);