fix: clear console mocks between tests in data-masking spec

The test was failing because mock.calls[0] was getting calls
from the previous test. Added mockClear() in beforeEach to
ensure each test starts with fresh mock state.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Martin Porwoll 2025-12-15 10:45:19 +00:00
parent 91d00b016e
commit 1f62563922

View file

@ -347,6 +347,10 @@ describe('Data Masking', () => {
vi.spyOn(console, 'log').mockImplementation(() => {}) vi.spyOn(console, 'log').mockImplementation(() => {})
vi.spyOn(console, 'error').mockImplementation(() => {}) vi.spyOn(console, 'error').mockImplementation(() => {})
vi.spyOn(console, 'warn').mockImplementation(() => {}) vi.spyOn(console, 'warn').mockImplementation(() => {})
// Clear any previous calls
vi.mocked(console.log).mockClear()
vi.mocked(console.error).mockClear()
vi.mocked(console.warn).mockClear()
}) })
it('creates logger with info method', () => { it('creates logger with info method', () => {