(id)
| 263 | await fs.writeFile(id, content, 'utf-8') |
| 264 | }, |
| 265 | async removeSnapshotFile(id) { |
| 266 | checkFileAccess(id) |
| 267 | if (!canWrite(project)) { |
| 268 | vitest.logger.error( |
| 269 | `[vitest] Cannot remove snapshot file "${id}". File writing is disabled because server is exposed to the internet, see https://vitest.dev/config/browser/api.`, |
| 270 | ) |
| 271 | return |
| 272 | } |
| 273 | if (!existsSync(id)) { |
| 274 | throw new Error(`Snapshot file "${id}" does not exist.`) |
| 275 | } |
| 276 | await fs.unlink(id) |
| 277 | }, |
| 278 | getBrowserFileSourceMap(id) { |
| 279 | const mod = globalServer.vite.moduleGraph.getModuleById(id) |
| 280 | const result = mod?.transformResult |
nothing calls this directly
no test coverage detected