🔧 chore(vitest): reset mocks and cleanup after each test
This commit is contained in:
@@ -3,3 +3,13 @@
|
|||||||
// expect(element).toHaveTextContent(/react/i)
|
// expect(element).toHaveTextContent(/react/i)
|
||||||
// learn more: https://github.com/testing-library/jest-dom
|
// learn more: https://github.com/testing-library/jest-dom
|
||||||
import '@testing-library/jest-dom'
|
import '@testing-library/jest-dom'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reset mocks and cleanup after each test
|
||||||
|
*/
|
||||||
|
import { cleanup } from '@testing-library/react'
|
||||||
|
import { vi, afterEach } from 'vitest'
|
||||||
|
afterEach(() => {
|
||||||
|
vi.resetAllMocks()
|
||||||
|
cleanup()
|
||||||
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user