MCPcopy Index your code
hub / github.com/fabien0102/openapi-codegen / createWriteFileMock

Function createWriteFileMock

plugins/typescript/src/testUtils.ts:20–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18 * Create a mock (like `vi.fn()`) with embedded prettier step.
19 */
20export const createWriteFileMock = () => {
21 const calls: [string, string][] = [];
22 async function fn(file: string, data: string) {
23 calls.push([
24 file,
25 await prettier.format(data, {
26 parser: "babel-ts",
27 }),
28 ]);
29 }
30
31 fn.mock = { calls };
32
33 return fn;
34};

Calls

no outgoing calls

Tested by

no test coverage detected