Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/penpal/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@
"typescript": "~5.9.0",
"unist-util-visit": "^5.1.0",
"vite": "^7.0.0",
"vitest": "^3.0.0"
"vitest": "^4.0.0"
}
}
3 changes: 2 additions & 1 deletion apps/penpal/frontend/src/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ vi.mock('./api', () => ({
isDesktopApp: false,
api: {
listProjects: vi.fn().mockResolvedValue([]),
getRecentFiles: vi.fn().mockResolvedValue([]),
getInReview: vi.fn().mockResolvedValue([]),
},
}));
Expand All @@ -19,7 +20,7 @@ vi.mock('./hooks/useSSE', () => ({
describe('App', () => {
it('renders the layout', async () => {
render(<App />);
// The router redirects / to /workspace/default
// With no projects, IndexRedirect falls back to /recent
expect(await screen.findByTestId('app-layout')).toBeInTheDocument();
});

Expand Down
11 changes: 0 additions & 11 deletions apps/penpal/frontend/src/test/setup.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
import '@testing-library/jest-dom';

// Suppress unhandled AbortSignal rejections from react-router in jsdom.
// Node 24+ (undici v7) rejects jsdom's AbortSignal polyfill as not a "real" instance.
// See: https://github.com/vitest-dev/vitest/issues/8374
// This will be unnecessary once we upgrade to Vitest 4.
process.removeAllListeners('unhandledRejection');
process.on('unhandledRejection', (reason: unknown) => {
if (reason instanceof TypeError && String(reason).includes('AbortSignal')) return;
// Re-throw anything that isn't the known jsdom/undici mismatch
throw reason;
});

// Ensure localStorage is available in jsdom environment
if (typeof globalThis.localStorage === 'undefined' || typeof globalThis.localStorage.clear !== 'function') {
const store: Record<string, string> = {};
Expand Down
Loading