You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got this working in a vitest/react-testing-library app using the following method. It's an alternative to patching it, which is what jest-preview does.
Add the following to your setupTests.ts file (or equivalent under setupFiles):
import{debug}from'vitest-preview';import{cleanup}from'@testing-library/react';afterEach(context=>{// Run vitest-preview's debug if the test failsif(context?.meta?.result?.state==='fail'){debug();}// Clean up react-testing-library. We need to manually do this because we// turn off the automatic teardown in the vite.config.// This needs to happen after vitest-preview.cleanup();});
Is your feature request related to a problem? Please describe.
Not related to a problem.
Describe the solution you'd like
A way to setup autoPreview.
Describe how should we implement this feature
Same functionality as
jest-preview
Describe alternatives you've considered
Attempt to setup
jest-preview
with vitest,Additional context
N/A
The text was updated successfully, but these errors were encountered: