diff --git a/tests/react/async.test.tsx b/tests/react/async.test.tsx index c44df23bf4..8ce9d47d75 100644 --- a/tests/react/async.test.tsx +++ b/tests/react/async.test.tsx @@ -68,10 +68,12 @@ it('does not show async stale result', async () => { await userEvent.click(getByText('button')) await findByText('loading') - resolve1() - resolve2() - await Promise.resolve() - resolve2() + await act(async () => { + resolve1() + resolve2() + await Promise.resolve() + resolve2() + }) await waitFor(() => { getByText('count: 2') getByText('delayedCount: 2') diff --git a/vitest.config.ts b/vitest.config.ts index 9d9b9bee25..bc01b05f65 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -20,5 +20,8 @@ export default defineConfig({ reporter: ['text', 'json', 'html', 'text-summary'], reportsDirectory: './coverage/', }, + onConsoleLog(log) { + if (log.includes('DOMException')) return false + }, }, })