Download react-query/packages/react-query-persist-client/test-setup.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 421 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/packages/react-query-persist-client/test-setup.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/packages/react-query-persist-client/test-setup.ts
-
curl -L -o test-setup.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/packages/react-query-persist-client/test-setup.ts
421 Bytes
| import '@testing-library/jest-dom/vitest' | |
| import { act, cleanup } from '@testing-library/react' | |
| import { afterEach } from 'vitest' | |
| import { notifyManager } from '@tanstack/react-query' | |
| // https://testing-library.com/docs/react-testing-library/api#cleanup | |
| afterEach(() => cleanup()) | |
| // Wrap notifications with act to make sure React knows about React Query updates | |
| notifyManager.setNotifyFunction((fn) => { | |
| act(fn) | |
| }) | |