mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-04 03:27:12 -05:00 
			
		
		
		
	
		
			
				
	
	
		
			25 lines
		
	
	
		
			606 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			606 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)
 | 
						|
}
 |