Skip to content

Commit

Permalink
test: silence console output when testing logger
Browse files Browse the repository at this point in the history
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
  • Loading branch information
susnux committed Feb 21, 2025
1 parent d7c697e commit fa9868a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions __tests__/utils/logger.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import logger from '../../lib/utils/logger'
// Just ensure correct app is set, rest is up to that library to test
test('logger', () => {
const spy = vi.spyOn(window.console, 'warn')
// silence the output to not spam the console
spy.mockImplementationOnce(() => {})

logger.warn('test')
expect(spy).toHaveBeenCalled()
Expand Down

0 comments on commit fa9868a

Please sign in to comment.