| 159 | } |
| 160 | |
| 161 | export class MockBuildCache<State> implements BuildCache<State> { |
| 162 | #files: FsRouteFile<State>[]; |
| 163 | root = ""; |
| 164 | clientEntry = ""; |
| 165 | islandRegistry: ServerIslandRegistry = new Map(); |
| 166 | features = { errorOverlay: false }; |
| 167 | |
| 168 | constructor(files: FsRouteFile<State>[], mode: "development" | "production") { |
| 169 | this.features.errorOverlay = mode === "development"; |
| 170 | this.#files = files; |
| 171 | } |
| 172 | |
| 173 | getEntryAssets(): string[] { |
| 174 | return []; |
| 175 | } |
| 176 | |
| 177 | getFsRoutes(): Command<State>[] { |
| 178 | return fsItemsToCommands(this.#files); |
| 179 | } |
| 180 | |
| 181 | readFile(_pathname: string): Promise<StaticFile | null> { |
| 182 | return Promise.resolve(null); |
| 183 | } |
| 184 | } |
| 185 | |
| 186 | /** |
| 187 | * Wrapper around `Deno.test` for integration tests that disables sanitizers. |
nothing calls this directly
no outgoing calls
no test coverage detected