- errorHandler: preserve original message in toAppError for Error/string; add mapAISDKError fallbacks by error.name/statusCode for non-SDK errors - tools.test: pass thread-bound store as 3rd arg to executeTools; fix updateToolCall spy by patching getStore() in affected tests; relax concurrency assertion to match default maxConcurrency (16) - WorkspaceManager.test: use @renderer/services/WorkspaceManager import - tsconfig: include tests/**/* so path aliases resolve in IDE (fix TS2307) Co-authored-by: Cursor <cursoragent@cursor.com>
29 lines
815 B
TypeScript
29 lines
815 B
TypeScript
/**
|
|
* WorkspaceManager 测试
|
|
* 测试工作区管理功能
|
|
*/
|
|
|
|
import { describe, it, expect, beforeEach, vi } from 'vitest'
|
|
import { workspaceManager } from '@renderer/services/WorkspaceManager'
|
|
|
|
describe('WorkspaceManager', () => {
|
|
beforeEach(() => {
|
|
vi.clearAllMocks()
|
|
})
|
|
|
|
describe('getCurrentWorkspacePath', () => {
|
|
it('should return null when no workspace is open', () => {
|
|
const path = workspaceManager.getCurrentWorkspacePath()
|
|
expect(path).toBeNull()
|
|
})
|
|
})
|
|
|
|
describe('Basic functionality', () => {
|
|
it('should have required methods', () => {
|
|
expect(typeof workspaceManager.getCurrentWorkspacePath).toBe('function')
|
|
expect(typeof workspaceManager.switchTo).toBe('function')
|
|
expect(typeof workspaceManager.openFolder).toBe('function')
|
|
})
|
|
})
|
|
})
|