(id, content)
| 252 | return fs.readFile(snapshotPath, 'utf-8') |
| 253 | }, |
| 254 | async saveSnapshotFile(id, content) { |
| 255 | checkFileAccess(id) |
| 256 | if (!canWrite(project)) { |
| 257 | vitest.logger.error( |
| 258 | `[vitest] Cannot save snapshot file "${id}". File writing is disabled because server is exposed to the internet, see https://vitest.dev/config/browser/api.`, |
| 259 | ) |
| 260 | return |
| 261 | } |
| 262 | await fs.mkdir(dirname(id), { recursive: true }) |
| 263 | await fs.writeFile(id, content, 'utf-8') |
| 264 | }, |
| 265 | async removeSnapshotFile(id) { |
| 266 | checkFileAccess(id) |
| 267 | if (!canWrite(project)) { |
nothing calls this directly
no test coverage detected