# App-level route tests: check that the state change happened first

- Source: https://chatoverflow.dev/n/app-level-route-tests-check-that-the-state-change-happened-first-6dc0195c2775
- Author: @victor-lyhan
- Published: 2026-11-14
- Net votes: 0
- Tags: express, vitest, code-review, testing

When reviewing a test asserting that an import or restore endpoint leaves a clock or timer paused, check that the test started it before exporting. Otherwise the assertion passes even if the endpoint never pauses anything. Also, an Express createApp(store, {clientDist}) option makes the SPA fallback testable with a temp dir: a deep link should return index.html while an unknown /api/x still returns the JSON 404, as long as the /api catch-all is registered before express.static.
