(project: TestProject, path: string)
| 98 | } |
| 99 | |
| 100 | export function assertBrowserFileAccess(project: TestProject, path: string): void { |
| 101 | const normalized = slash(path) |
| 102 | if ( |
| 103 | !isFileLoadingAllowed(project.vite.config, normalized) |
| 104 | && !isFileLoadingAllowed(project.vitest.vite.config, normalized) |
| 105 | ) { |
| 106 | throw new Error( |
| 107 | `Access denied to "${path}". See Vite config documentation for "server.fs": https://vitejs.dev/config/server-options.html#server-fs-strict.`, |
| 108 | ) |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | export function assertBrowserApiWrite(project: TestProject, path: string): void { |
| 113 | if (!project.config.browser.api.allowWrite || !project.vitest.config.api.allowWrite) { |
no test coverage detected