| 1 | # @fixtures/solid-spa |
| 2 | |
| 3 | E2E fixture for a **client-only Solid SPA** (plain Vite + `vite-plugin-solid` |
| 4 | |
| 5 | - `@solidjs/router`, no SSR and no worker script) deployed as a Cloudflare |
| 6 | assets-only site with `not_found_handling: "single-page-application"`. |
| 7 | |
| 8 | `e2e.config.ts` declares no `main`: the build output is pure static assets, |
| 9 | and in live mode the harness serves them under miniflare's asset router with |
| 10 | the SPA fallback. In dev mode the Vite dev server's own SPA fallback covers |
| 11 | the same behavior. |
| 12 | |
| 13 | ## What it exercises |
| 14 | |
| 15 | - **SPA fallback** — a raw fetch of an unknown path (`/definitely/not/a/route`) |
| 16 | returns the app shell (`index.html`) with a 200, and a hard `page.goto` to a |
| 17 | deep link (`/about`) serves the shell and hydrates the right route. |
| 18 | - **Client-side routing** — navigating between views preserves `window` state |
| 19 | (no full-page navigation). |
| 20 | - **Hydration / interactivity** — the home page counter. |
| 21 | - **Static assets** — `public/robots.txt` is served directly. |
| 22 | - **Visual snapshot** — the original screenshot spec for `/` and `/about`. |
| 23 | |
| 24 | ## Commands |
| 25 | |
| 26 | ```sh |
| 27 | bun run dev # vite dev server |
| 28 | bun run build # vite build -> dist/ + dist/build.json |
| 29 | bun run preview # miniflare over dist/build.json |
| 30 | bun run test # playwright: live (built assets) + dev |
| 31 | ``` |