Files
supabase/examples/angular-todo-list/test-config.helper.ts
T
geromegrignon 13533229a9 feat: add Angular todo list example
add Angular todo list source code
add the example to the existing list on supabase.io
add codeowners file for automated assignment fo reviews
2021-07-14 23:20:57 +02:00

22 lines
600 B
TypeScript

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)
}