1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00
pigallery2/src/frontend/test.ts

30 lines
768 B
TypeScript
Raw Normal View History

2019-12-10 18:13:27 +08:00
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
import 'zone.js/dist/zone-testing';
2022-04-05 01:37:31 +08:00
import {getTestBed} from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
2022-04-05 01:37:31 +08:00
platformBrowserDynamicTesting,
} from '@angular/platform-browser-dynamic/testing';
2019-12-10 18:13:27 +08:00
declare const require: {
2022-04-05 01:37:31 +08:00
context(
path: string,
deep?: boolean,
filter?: RegExp
): {
keys(): string[];
<T>(id: string): T;
};
2019-12-10 18:13:27 +08:00
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);