( moduleDef: TestModuleMetadata, fn?: Function | null, )
| 1097 | export function withModule(moduleDef: TestModuleMetadata): InjectSetupWrapper; |
| 1098 | export function withModule(moduleDef: TestModuleMetadata, fn: Function): () => any; |
| 1099 | export function withModule( |
| 1100 | moduleDef: TestModuleMetadata, |
| 1101 | fn?: Function | null, |
| 1102 | ): (() => any) | InjectSetupWrapper { |
| 1103 | if (fn) { |
| 1104 | // Not using an arrow function to preserve context passed from call site |
| 1105 | return function (this: unknown) { |
| 1106 | const testBed = TestBedImpl.INSTANCE; |
| 1107 | if (moduleDef) { |
| 1108 | testBed.configureTestingModule(moduleDef); |
| 1109 | } |
| 1110 | return fn.apply(this); |
| 1111 | }; |
| 1112 | } |
| 1113 | return new InjectSetupWrapper(() => moduleDef); |
| 1114 | } |
| 1115 | |
| 1116 | /** Host component used when creating directives during tests. */ |
| 1117 | class DirectiveTestHost { |
no test coverage detected