MCPcopy Create free account
hub / github.com/ampproject/amphtml / getErrorFunction

Function getErrorFunction

test/e2e/test-controller-promise.js:232–245  ·  view source on GitHub ↗

* Returns a method that rejects on its fourth call. * @return {function():!Promise }

()

Source from the content-addressed store, hash-verified

230 * @return {function():!Promise<number>}
231 */
232 function getErrorFunction() {
233 const errorFunction = sandbox.stub();
234 errorFunction.rejects();
235 errorFunction
236 .onCall(0)
237 .resolves(0)
238 .onCall(1)
239 .resolves(1)
240 .onCall(2)
241 .resolves(2)
242 .onCall(3)
243 .resolves(3);
244 return errorFunction;
245 }
246
247 /**
248 * Simulate the WebDriver polling functionality to get the latest value

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected