mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-19 14:41:24 +08:00
fix: format
This commit is contained in:
parent
f95b040b07
commit
ac4285b9f2
@ -205,10 +205,7 @@ describe('BackupManager.deleteTempBackup - Security Tests', () => {
|
|||||||
const result = await backupManager.deleteTempBackup({} as Electron.IpcMainInvokeEvent, validPath)
|
const result = await backupManager.deleteTempBackup({} as Electron.IpcMainInvokeEvent, validPath)
|
||||||
|
|
||||||
expect(result).toBe(false)
|
expect(result).toBe(false)
|
||||||
expect(mockLogger.error).toHaveBeenCalledWith(
|
expect(mockLogger.error).toHaveBeenCalledWith(expect.stringContaining('Failed to delete'), expect.any(Error))
|
||||||
expect.stringContaining('Failed to delete'),
|
|
||||||
expect.any(Error)
|
|
||||||
)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should return false on fs.pathExists error', async () => {
|
it('should return false on fs.pathExists error', async () => {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { EventEmitter } from 'events'
|
import { EventEmitter } from 'events'
|
||||||
import { afterEach, beforeEach, describe, expect, it, type Mock,vi } from 'vitest'
|
import { afterEach, beforeEach, describe, expect, it, type Mock, vi } from 'vitest'
|
||||||
|
|
||||||
// Create mock objects before vi.mock calls
|
// Create mock objects before vi.mock calls
|
||||||
const mockLogger = {
|
const mockLogger = {
|
||||||
|
|||||||
@ -96,7 +96,6 @@ describe('LanTransferClientService', () => {
|
|||||||
})
|
})
|
||||||
).rejects.toThrow('Unable to resolve a reachable host for the peer')
|
).rejects.toThrow('Unable to resolve a reachable host for the peer')
|
||||||
})
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('cancelTransfer', () => {
|
describe('cancelTransfer', () => {
|
||||||
|
|||||||
@ -33,7 +33,7 @@ describe('connection handlers', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('should use protocol version 1', () => {
|
it('should use protocol version 1', () => {
|
||||||
expect(HANDSHAKE_PROTOCOL_VERSION).toBe('1')
|
expect(HANDSHAKE_PROTOCOL_VERSION).toBe('1')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,13 @@ import type { Socket } from 'node:net'
|
|||||||
|
|
||||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||||
|
|
||||||
import { abortTransfer, cleanupTransfer, createTransferState, formatFileSize, streamFileChunks } from '../../handlers/fileTransfer'
|
import {
|
||||||
|
abortTransfer,
|
||||||
|
cleanupTransfer,
|
||||||
|
createTransferState,
|
||||||
|
formatFileSize,
|
||||||
|
streamFileChunks
|
||||||
|
} from '../../handlers/fileTransfer'
|
||||||
import type { ActiveFileTransfer } from '../../types'
|
import type { ActiveFileTransfer } from '../../types'
|
||||||
|
|
||||||
// Mock binaryProtocol
|
// Mock binaryProtocol
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user