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