MCPcopy Create free account
hub / github.com/angular/angular / test

Function test

packages/core/rxjs-interop/test/to_signal_spec.ts:374–385  ·  view source on GitHub ↗
(fn: () => void | Promise<void>)

Source from the content-addressed store, hash-verified

372});
373
374function 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}

Callers 6

to_signal_spec.tsFile · 0.70
_runTestFunction · 0.50
jest.spec.jsFile · 0.50

Calls 3

runInInjectionContextFunction · 0.90
createMethod · 0.65
destroyMethod · 0.65

Tested by

no test coverage detected