MCPcopy Create free account
hub / github.com/Snowflyt/tinyeffect / mockReader

Function mockReader

test/effected.spec.ts:231–234  ·  view source on GitHub ↗
(content: string, type: "resolve" | "reject")

Source from the content-addressed store, hash-verified

229 const read = effect("read")<[], string>;
230
231 const mockReader = (content: string, type: "resolve" | "reject") => () =>
232 new Promise<string>((resolve, reject) =>
233 setTimeout(() => (type === "resolve" ? resolve(content) : reject(new Error("error"))), 0),
234 );
235
236 const readIt = (reader: () => Promise<string>) =>
237 effected(function* () {

Callers 1

effected.spec.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected