Moves the app to TanStack Start with prerendering
Every page is now built as HTML from sitePages.ts, with a catch-all route for 404.html. Hooks that read the browser during render are safe for prerendering. The script step that keeps the CSP intact follows, so this build still has inline scripts and is not deployable yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -9,11 +9,15 @@ describe('usePageLoaded', () => {
|
||||
});
|
||||
|
||||
it('turns true on the load event', () => {
|
||||
vi.spyOn(document, 'readyState', 'get').mockReturnValue('interactive');
|
||||
const readyState = vi
|
||||
.spyOn(document, 'readyState', 'get')
|
||||
.mockReturnValue('interactive');
|
||||
const { result } = renderHook(() => usePageLoaded());
|
||||
expect(result.current).toBe(false);
|
||||
|
||||
act(() => {
|
||||
// The browser is 'complete' by the time the load event fires
|
||||
readyState.mockReturnValue('complete');
|
||||
window.dispatchEvent(new Event('load'));
|
||||
});
|
||||
expect(result.current).toBe(true);
|
||||
|
||||
Reference in New Issue
Block a user