fix(jest): replace mock with jest.spyOn

Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ 2023-06-20 11:53:20 +02:00
parent 809631539e
commit 70ee8de0ab
No known key found for this signature in database
GPG key ID: 60C25B8C072916CF
2 changed files with 3 additions and 3 deletions

View file

@ -161,8 +161,8 @@ describe('Delete action execute tests', () => {
})
test('Delete fails', async () => {
axios.delete = jest.fn(() => { throw new Error('Mock error') })
logger.error = jest.fn()
jest.spyOn(axios, 'delete').mockImplementation(() => { throw new Error('Mock error') })
jest.spyOn(logger, 'error').mockImplementation(() => jest.fn())
const file = new File({
id: 1,

View file

@ -126,8 +126,8 @@ describe('Open sidebar action exec tests', () => {
test('Open sidebar fails', async () => {
const openMock = jest.fn(() => { throw new Error('Mock error') })
logger.error = jest.fn()
window.OCA = { Files: { Sidebar: { open: openMock } } }
jest.spyOn(logger, 'error').mockImplementation(() => jest.fn())
const file = new File({
id: 1,