(fn: () => void | Promise<void>)
| 382 | }); |
| 383 | |
| 384 | function test(fn: () => void | Promise<void>): () => Promise<void> { |
| 385 | return async () => { |
| 386 | const injector = Injector.create({ |
| 387 | providers: [{provide: EnvironmentInjector, useFactory: () => injector}], |
| 388 | }) as EnvironmentInjector; |
| 389 | try { |
| 390 | return await runInInjectionContext(injector, fn); |
| 391 | } finally { |
| 392 | injector.destroy(); |
| 393 | } |
| 394 | }; |
| 395 | } |
no test coverage detected