mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-18 21:16:47 +00:00
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:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user