test: give async assertions a realistic budget on CI

waitFor and findBy* default to 1s. That holds on a dev machine but not on a
4-core runner executing 527 test files in parallel forks, where three import
dialog tests timed out waiting for their upload to settle.
This commit is contained in:
Maurice
2026-07-29 10:50:23 +02:00
committed by Maurice
parent 99816bff4c
commit 16922766e5
+7 -1
View File
@@ -1,9 +1,15 @@
import '@testing-library/jest-dom/vitest';
import 'fake-indexeddb/auto';
import { cleanup } from '@testing-library/react';
import { cleanup, configure } from '@testing-library/react';
import { afterAll, afterEach, beforeAll, vi } from 'vitest';
import { server } from './helpers/msw/server';
// waitFor/findBy* default to 1s, which is enough on a dev machine but not on a
// 4-core CI runner running the whole suite in parallel forks — a multipart POST
// through MSW plus an IndexedDB write can exceed it. Still well inside the 15s
// testTimeout, so a genuinely broken assertion fails, it just takes longer.
configure({ asyncUtilTimeout: 5000 });
// Mock the websocket module so stores don't try to open real connections
vi.mock('../src/api/websocket', () => ({
connect: vi.fn(),