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

Function runAsyncTestFn

packages/platform-browser/test/testing_public_spec.ts:956–962  ·  view source on GitHub ↗
(fn: (done: DoneFn) => void)

Source from the content-addressed store, hash-verified

954
955 describe('errors', () => {
956 const runAsyncTestFn = (fn: (done: DoneFn) => void) => {
957 const {promise, resolve, reject} = Promise.withResolvers<any>();
958 const done = <DoneFn>(() => resolve(null));
959 done.fail = (err) => reject(err);
960 fn(done);
961 return promise;
962 };
963
964 it('should fail when an asynchronous error is thrown', (done) => {
965 const barError = new Error('bar');

Callers 1

Calls 4

rejectFunction · 0.85
withResolversMethod · 0.65
resolveFunction · 0.50
fnFunction · 0.50

Tested by

no test coverage detected