test: Add comprehensive unit tests for shared packages

Add 88 new unit tests covering critical business logic in shared packages:

- libs/git-utils/tests/diff.test.ts (22 tests)
  * Synthetic diff generation for new files
  * Binary file handling
  * Large file handling
  * Untracked file diff appending
  * Directory file listing with exclusions
  * Non-git directory handling

- libs/dependency-resolver/tests/resolver.test.ts (30 tests)
  * Topological sorting with dependencies
  * Priority-aware ordering
  * Circular dependency detection
  * Missing dependency tracking
  * Blocked feature detection
  * Complex dependency graphs

- libs/utils/tests/error-handler.test.ts (36 tests)
  * Abort error detection
  * Cancellation error detection
  * Authentication error detection
  * Error classification logic
  * User-friendly error messages

All tests use vitest and follow best practices with proper setup/teardown.

Resolves PR review issue #1 (HIGH PRIORITY)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Kacper
2025-12-20 22:48:43 +01:00
parent 46994bea34
commit 0cef537a3d
8 changed files with 958 additions and 17 deletions

View File

@@ -343,13 +343,8 @@ Understanding the dependency chain helps prevent circular dependencies:
All packages must be built before use:
```bash
# Build all packages
cd libs/types && npm run build
cd libs/utils && npm run build
cd libs/platform && npm run build
cd libs/model-resolver && npm run build
cd libs/dependency-resolver && npm run build
cd libs/git-utils && npm run build
# Build all packages from workspace
npm run build:packages
# Or from root
npm install # Installs and links workspace packages