mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-08-22 01:01:04 +00:00
chore: replace karma with jest
This commit is contained in:
21
src-ui/test-config.helper.ts
Normal file
21
src-ui/test-config.helper.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
type CompilerOptions = Partial<{
|
||||
providers: any[];
|
||||
useJit: boolean;
|
||||
preserveWhitespaces: boolean;
|
||||
}>;
|
||||
export type ConfigureFn = (testBed: typeof TestBed) => void;
|
||||
|
||||
export const configureTests = (configure: ConfigureFn, compilerOptions: CompilerOptions = {}) => {
|
||||
const compilerConfig: CompilerOptions = {
|
||||
preserveWhitespaces: false,
|
||||
...compilerOptions,
|
||||
};
|
||||
|
||||
const configuredTestBed = TestBed.configureCompiler(compilerConfig);
|
||||
|
||||
configure(configuredTestBed);
|
||||
|
||||
return configuredTestBed.compileComponents().then(() => configuredTestBed);
|
||||
};
|
Reference in New Issue
Block a user