🔧 chore(vitest): reset mocks and cleanup after each test

This commit is contained in:
2024-02-17 14:35:16 +01:00
parent f5c3a5f306
commit 35dc2a45a9
+10
View File
@@ -3,3 +3,13 @@
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/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()
})