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

18
package-lock.json generated
View File

@@ -20,6 +20,7 @@
"apps/server": {
"name": "@automaker/server",
"version": "0.1.0",
"license": "SEE LICENSE IN LICENSE",
"dependencies": {
"@anthropic-ai/claude-agent-sdk": "^0.1.72",
"@automaker/dependency-resolver": "^1.0.0",
@@ -62,7 +63,7 @@
"name": "@automaker/ui",
"version": "0.1.0",
"hasInstallScript": true,
"license": "Unlicense",
"license": "SEE LICENSE IN LICENSE",
"dependencies": {
"@automaker/dependency-resolver": "^1.0.0",
"@automaker/types": "^1.0.0",
@@ -162,12 +163,14 @@
"libs/dependency-resolver": {
"name": "@automaker/dependency-resolver",
"version": "1.0.0",
"license": "SEE LICENSE IN LICENSE",
"dependencies": {
"@automaker/types": "^1.0.0"
},
"devDependencies": {
"@types/node": "^22.10.5",
"typescript": "^5.7.3"
"typescript": "^5.7.3",
"vitest": "^4.0.16"
}
},
"libs/dependency-resolver/node_modules/@types/node": {
@@ -183,13 +186,15 @@
"libs/git-utils": {
"name": "@automaker/git-utils",
"version": "1.0.0",
"license": "SEE LICENSE IN LICENSE",
"dependencies": {
"@automaker/types": "^1.0.0",
"@automaker/utils": "^1.0.0"
},
"devDependencies": {
"@types/node": "^22.10.5",
"typescript": "^5.7.3"
"typescript": "^5.7.3",
"vitest": "^4.0.16"
}
},
"libs/git-utils/node_modules/@types/node": {
@@ -205,6 +210,7 @@
"libs/model-resolver": {
"name": "@automaker/model-resolver",
"version": "1.0.0",
"license": "SEE LICENSE IN LICENSE",
"dependencies": {
"@automaker/types": "^1.0.0"
},
@@ -226,6 +232,7 @@
"libs/platform": {
"name": "@automaker/platform",
"version": "1.0.0",
"license": "SEE LICENSE IN LICENSE",
"dependencies": {
"@automaker/types": "^1.0.0"
},
@@ -507,6 +514,7 @@
"libs/types": {
"name": "@automaker/types",
"version": "1.0.0",
"license": "SEE LICENSE IN LICENSE",
"devDependencies": {
"@types/node": "^22.10.5",
"typescript": "^5.7.3"
@@ -525,12 +533,14 @@
"libs/utils": {
"name": "@automaker/utils",
"version": "1.0.0",
"license": "SEE LICENSE IN LICENSE",
"dependencies": {
"@automaker/types": "^1.0.0"
},
"devDependencies": {
"@types/node": "^22.10.5",
"typescript": "^5.7.3"
"typescript": "^5.7.3",
"vitest": "^4.0.16"
}
},
"libs/utils/node_modules/@types/node": {