Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test(files_trashbin): add test coverage also for utils like the logger
Signed-off-by: Ferdinand Thiessen <[email protected]>
  • Loading branch information
susnux committed Mar 11, 2025
commit f4d0478b4b2000d144b632b74e0da3aa898356a5
20 changes: 20 additions & 0 deletions apps/files_trashbin/src/logger.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

import { describe, expect, it, vi } from 'vitest'
import { logger } from './logger.ts'

describe('files_trashbin: logger', () => {
// Rest of the logger is not under our responsibility but nextcloud-logger
it('has correct app name set up', () => {
const consoleSpy = vi.spyOn(globalThis.console, 'error').mockImplementationOnce(() => {})

logger.error('<message>')
expect(consoleSpy).toBeCalledTimes(1)
expect(consoleSpy.mock.calls[0][0]).toContain('<message>')
expect(consoleSpy.mock.calls[0][0]).toContain('files_trashbin')
expect(consoleSpy.mock.calls[0][1].app).toBe('files_trashbin')
})
})