MCPcopy
hub / github.com/angular/angular / whenStable

Method whenStable

packages/core/testing/src/component_fixture.ts:234–246  ·  view source on GitHub ↗

* Get a promise that resolves when the fixture is stable. * * This can be used to resume testing after events have triggered asynchronous activity or * asynchronous change detection.

()

Source from the content-addressed store, hash-verified

232 * asynchronous change detection.
233 */
234 whenStable(): Promise<any> {
235 if (this.isStable()) {
236 return Promise.resolve(false);
237 }
238
239 return new Promise((resolve, reject) => {
240 this.appErrorHandler.whenStableRejectFunctions.add(reject);
241 this._appRef.whenStable().then(() => {
242 this.appErrorHandler.whenStableRejectFunctions.delete(reject);
243 resolve(true);
244 });
245 });
246 }
247
248 /**
249 * Retrieves all defer block fixtures in the component fixture.

Callers 1

whenRenderingDoneMethod · 0.95

Calls 7

isStableMethod · 0.95
resolveFunction · 0.70
resolveMethod · 0.65
addMethod · 0.65
thenMethod · 0.65
whenStableMethod · 0.65
deleteMethod · 0.45

Tested by

no test coverage detected