(fn: () => void | Promise<void>)
| 372 | }); |
| 373 | |
| 374 | function test(fn: () => void | Promise<void>): () => Promise<void> { |
| 375 | return async () => { |
| 376 | const injector = Injector.create({ |
| 377 | providers: [{provide: EnvironmentInjector, useFactory: () => injector}], |
| 378 | }) as EnvironmentInjector; |
| 379 | try { |
| 380 | return await runInInjectionContext(injector, fn); |
| 381 | } finally { |
| 382 | injector.destroy(); |
| 383 | } |
| 384 | }; |
| 385 | } |
no test coverage detected