test-utils.tsx (525B)
1 /* eslint-disable import/export */ 2 import { cleanup, render } from '@testing-library/react' 3 import { afterEach } from 'vitest' 4 5 afterEach(() => { 6 cleanup() 7 }) 8 9 const customRender = (ui: React.ReactElement, options = {}) => 10 render(ui, { 11 // wrap provider(s) here if needed 12 wrapper: ({ children }) => children, 13 ...options, 14 }) 15 16 export * from '@testing-library/react' 17 export { default as userEvent } from '@testing-library/user-event' 18 // override render export 19 export { customRender as render }