Open History to see the last commit
1import '@testing-library/jest-dom/vitest'
2import { act, cleanup as cleanupRTL } from '@testing-library/react'
3import { cleanup as cleanupRRS } from '@testing-library/react-render-stream'
4import { afterEach } from 'vitest'
5import { notifyManager } from '@tanstack/query-core'
6β
7// https://testing-library.com/docs/react-testing-library/api#cleanup
8afterEach(() => {
9 cleanupRTL()
10 cleanupRRS()
11})
12β
13// Wrap notifications with act to make sure React knows about React Query updates
14notifyManager.setNotifyFunction((fn) => {
15 act(fn)
16})