(filePath)
| 105 | const invalidPath = "/tmp/locale-sorter-invalid.json"; |
| 106 | const writes = []; |
| 107 | const readStub = (filePath) => { |
| 108 | if (filePath === validPath) { |
| 109 | return '{"z":1,"a":2}'; |
| 110 | } |
| 111 | if (filePath === invalidPath) { |
| 112 | return '{"a":'; |
| 113 | } |
| 114 | throw new Error(`Unexpected file read: ${String(filePath)}`); |
| 115 | }; |
| 116 | const writeStub = (...args) => { |
| 117 | writes.push(args); |
| 118 | }; |