(id)
| 276 | await fs.writeFile(id, content, 'utf-8') |
| 277 | }, |
| 278 | async removeSnapshotFile(id) { |
| 279 | checkFileAccess(id) |
| 280 | if (!canWrite(project)) { |
| 281 | vitest.logger.error( |
| 282 | `[vitest] Cannot remove snapshot file "${id}". File writing is disabled because server is exposed to the internet, see https://vitest.dev/config/browser/api.`, |
| 283 | ) |
| 284 | return |
| 285 | } |
| 286 | if (!existsSync(id)) { |
| 287 | throw new Error(`Snapshot file "${id}" does not exist.`) |
| 288 | } |
| 289 | await fs.unlink(id) |
| 290 | }, |
| 291 | getBrowserFileSourceMap(id) { |
| 292 | const mod = globalServer.vite.moduleGraph.getModuleById(id) |
| 293 | const result = mod?.transformResult |
nothing calls this directly
no test coverage detected