Skip to content

Commit

Permalink
Merge pull request #1602 from nextcloud-libraries/test/silence-console
Browse files Browse the repository at this point in the history
test: silence console output when testing logger
  • Loading branch information
susnux authored Feb 21, 2025
2 parents 779f6dc + fa9868a commit 21e3745
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 21e3745

Please sign in to comment.