fix: resolve TypeScript type errors in test files

- Add vitest/globals to tsconfig.json types array to provide type
  definitions for global test functions (describe, it, expect, vi)
- Fix vi.fn type parameter in useDirectorySettings.test.tsx from
  <[], Promise<string>> to <() => Promise<string>>
- Remove unused setMcpConfig import from MSW handlers
- Add type assertions for mock.calls access in McpFormModal tests
  to resolve union type inference issues

This ensures pnpm typecheck passes without errors while maintaining
test functionality with vitest globals: true configuration.
This commit is contained in:
Jason
2025-10-27 13:29:12 +08:00
parent d064cb8555
commit bfab1d0ccb
4 changed files with 6 additions and 6 deletions

View File

@@ -17,7 +17,8 @@
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
}
},
"types": ["vitest/globals"]
},
"include": ["src/**/*", "tests/**/*"],
"references": [{ "path": "./tsconfig.node.json" }]