MCPcopy
hub / github.com/ampproject/amphtml / whenCalled

Function whenCalled

testing/helpers/service.js:69–74  ·  view source on GitHub ↗
(spy, opt_callCount = 1)

Source from the content-addressed store, hash-verified

67 * @return {!Promise}
68 */
69export function whenCalled(spy, opt_callCount = 1) {
70 return poll(
71 `Spy was called ${opt_callCount} times`,
72 () => spy.callCount === opt_callCount
73 );
74}
75
76/**
77 * Resolves a promise when the callback returns a truthy value.

Callers 13

test-action.jsFile · 0.90
test-amp-list.jsFile · 0.90
waitForRenderFunction · 0.90
test-amp-form.jsFile · 0.90
test-amp-iframe.jsFile · 0.90
test-consent-ui.jsFile · 0.90

Calls 1

pollFunction · 0.90

Tested by

no test coverage detected