Skip to content

Commit

Permalink
chore(tests): suppress logs
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi committed Feb 23, 2024
1 parent a520b51 commit cdc5276
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/react/async.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
3 changes: 3 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@ export default defineConfig({
reporter: ['text', 'json', 'html', 'text-summary'],
reportsDirectory: './coverage/',
},
onConsoleLog(log) {
if (log.includes('DOMException')) return false
},
},
})

0 comments on commit cdc5276

Please sign in to comment.