mirror of
https://github.com/nextcloud/server.git
synced 2026-04-26 00:27:49 -04:00
test(files_trashbin): add test coverage also for utils like the logger
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
a60a24e61e
commit
f4d0478b4b
1 changed files with 20 additions and 0 deletions
20
apps/files_trashbin/src/logger.spec.ts
Normal file
20
apps/files_trashbin/src/logger.spec.ts
Normal file
|
|
@ -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')
|
||||
})
|
||||
})
|
||||
Loading…
Reference in a new issue