snapshot of https://github.com/TanStack/query.git (main, 2026-09-16; blobs > 131072B omitted)
This commit is contained in:
14
packages/preact-query-persist-client/test-setup.ts
Normal file
14
packages/preact-query-persist-client/test-setup.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import '@testing-library/jest-dom/vitest'
|
||||
import { act, cleanup as cleanupRTL } from '@testing-library/preact'
|
||||
import { afterEach } from 'vitest'
|
||||
import { notifyManager } from '@tanstack/preact-query'
|
||||
|
||||
// https://testing-library.com/docs/preact-testing-library/api#cleanup
|
||||
afterEach(() => {
|
||||
cleanupRTL()
|
||||
})
|
||||
|
||||
// Wrap notifications with act to make sure Preact knows about Query updates
|
||||
notifyManager.setNotifyFunction((fn) => {
|
||||
act(fn)
|
||||
})
|
||||
Reference in New Issue
Block a user