()
| 18 | * Create a mock (like `vi.fn()`) with embedded prettier step. |
| 19 | */ |
| 20 | export 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 | }; |
no outgoing calls
no test coverage detected