mirror of
https://github.com/complexcaresolutions/cms.c2sgmbh.git
synced 2026-03-17 20:54:11 +00:00
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:
parent
91d00b016e
commit
1f62563922
1 changed files with 4 additions and 0 deletions
|
|
@ -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', () => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue