MCPcopy
hub / github.com/freshframework/fresh / MockBuildCache

Class MockBuildCache

packages/fresh/src/test_utils.ts:161–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159}
160
161export 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.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected