- Notifications
You must be signed in to change notification settings - Fork24
Commite638f58
feat: refactor remote.ts for testability and add comprehensive tests
Refactor remote.ts by extracting 5 testable helper methods:- validateCredentials() - handles login flow and credential validation- createWorkspaceClient() - creates workspace REST client- setupBinary() - handles binary path setup for prod/dev modes- validateServerVersion() - checks server compatibility and features- fetchWorkspace() - fetches workspace with comprehensive error handlingAdd remote.test.ts with 17 comprehensive test cases covering:- Constructor and instance creation- Credential validation and login prompts- Binary setup for production and development modes- Server version validation and incompatibility handling- Workspace fetching with 404/401 error scenarios- Remote window management (close/reload operations)Benefits:- Improved code maintainability through method extraction- Reduced complexity in main setup() method- Comprehensive error scenario testing- Memory-efficient testing approach vs extensive mocking- Maintains all existing functionality while enabling better testingTotal test coverage: 274 tests across 14 files (14/17 source files = 82%)🤖 Generated with [Claude Code](https://claude.ai/code)Co-Authored-By: Claude <noreply@anthropic.com>1 parentadc144b commite638f58
2 files changed
+664
-162
lines changed0 commit comments
Comments
(0)