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

Function getValueFunction

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

* Returns a method that resolves the numbers 0 through 6. * @return {function():!Promise }

()

Source from the content-addressed store, hash-verified

206 * @return {function():!Promise<number>}
207 */
208 function getValueFunction() {
209 const valueFunction = sandbox.stub();
210 valueFunction.resolves(6);
211 valueFunction
212 .onCall(0)
213 .resolves(0)
214 .onCall(1)
215 .resolves(1)
216 .onCall(2)
217 .resolves(2)
218 .onCall(3)
219 .resolves(3)
220 .onCall(4)
221 .resolves(4)
222 .onCall(5)
223 .resolves(5);
224
225 return valueFunction;
226 }
227
228 /**
229 * Returns a method that rejects on its fourth call.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected