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

Function test

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

Source from the content-addressed store, hash-verified

382});
383
384function 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}

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