MCPcopy
hub / github.com/angular/angular / test

Function test

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

Source from the content-addressed store, hash-verified

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

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

Used in the wild real call sites across dependent graphs

searching dependent graphs…