MCPcopy Create free account
hub / github.com/OneNoteDev/WebClipper / fnGenerator

Method fnGenerator

src/tests/promiseUtils_tests.ts:104–112  ·  view source on GitHub ↗
(callsUntilSucceed: number)

Source from the content-addressed store, hash-verified

102 }
103
104 private fnGenerator(callsUntilSucceed: number): () => Promise<string> {
105 return (() => {
106 this.callCount++;
107 if (this.callCount === callsUntilSucceed) {
108 return Promise.resolve(this.expectedResolve);
109 }
110 return Promise.reject(this.expectedReject);
111 }).bind(this);
112 }
113}
114
115(new PromiseUtilsTests()).runTests();

Callers 1

testsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected