- Notifications
You must be signed in to change notification settings - Fork24
Commit6291f7f
refactor: improve testability through dependency injection and test simplification
- Convert Storage to use dependency injection for Logger - Changed constructor to accept Logger as optional parameter - Removed setLogger method to follow constructor injection pattern - Updated all usage sites to pass Logger at construction time- Extract UIProvider interface for better testability - Created UIProvider interface to abstract VS Code UI operations - Implemented DefaultUIProvider for production use - Added createTestUIProvider factory for consistent test mocking- Remove eslint-disable comments and improve type safety - Eliminated 3 eslint-disable comments from commands.test.ts - Fixed all TypeScript type issues without using 'any' - Properly typed all mock functions and test helpers- Consolidate test helpers and remove redundant code - Moved all mock creation to test-helpers.ts - Removed testUIProvider.ts and testUIProvider.test.ts (consolidated) - Removed uiProvider.test.ts (pointless delegation tests) - Added withUrlHistory to mock Storage for complete coverage- Simplify tests and use real objects where possible - Replaced mock-heavy tests with simpler assertions - Used real Logger instances in tests instead of mocks - Removed tests that were testing implementation detailsThis refactoring improves maintainability, follows SOLID principles,and makes the codebase more testable without compromising functionality.🤖 Generated with [Claude Code](https://claude.ai/code)Co-Authored-By: Claude <noreply@anthropic.com>1 parent1a9f34f commit6291f7f
File tree
11 files changed
+2809
-382
lines changed- src
11 files changed
+2809
-382
lines changedLines changed: 62 additions & 16 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
75 | 75 |
| |
76 | 76 |
| |
77 | 77 |
| |
78 |
| - | |
79 |
| - | |
| 78 | + | |
| 79 | + | |
80 | 80 |
| |
81 | 81 |
| |
82 | 82 |
| |
| 83 | + | |
83 | 84 |
| |
84 | 85 |
| |
85 | 86 |
| |
| |||
181 | 182 |
| |
182 | 183 |
| |
183 | 184 |
| |
184 |
| - | |
| 185 | + | |
185 | 186 |
| |
186 |
| - | |
| 187 | + | |
187 | 188 |
| |
188 |
| - | |
189 |
| - | |
190 |
| - | |
191 |
| - | |
| 189 | + | |
192 | 190 |
| |
193 |
| - | |
| 191 | + | |
194 | 192 |
| |
195 |
| - | |
196 |
| - | |
197 |
| - | |
| 193 | + | |
198 | 194 |
| |
199 |
| - | |
200 |
| - | |
201 |
| - | |
202 |
| - | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + |
0 commit comments
Comments
(0)