Skip to content

Commit 524827f

Browse files
committed
feat: add tests, file locking, and CI test integration
- Add vitest test framework with 24 tests across 4 test files - Token estimation tests (5 tests) - Tool executor tests (8 tests) - reads, writes, patches, deletes, shell, security, path traversal - Settings manager tests (4 tests) - defaults, save/load, dot paths, corrupt settings - Provider tests (7 tests) - model routing, retry logic with backoff - Add file locking system (src/core/lock.ts) for concurrent agent operations - Wire file locking into tool executor for write operations - Add test script to package.json (npm test, npm run test:watch) - Add npm test step to CI workflow - Fast retry delays in test mode (10/20/30ms vs 1s/3s/8s)
1 parent c981614 commit 524827f

16 files changed

Lines changed: 1648 additions & 24 deletions

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ jobs:
3232
- name: Build
3333
run: npm run build
3434

35+
- name: Run tests
36+
run: npm test
37+
3538
- name: Verify dist output
3639
run: |
3740
FILE_COUNT=$(find dist -name "*.js" | wc -l)

dist/providers/client.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Provider, Message, ToolCall, ModelRouting } from '../core/types.js';
2+
export declare function retryWithBackoff<T>(fn: () => Promise<T>, context: string, signal?: AbortSignal): Promise<T>;
23
export interface StreamChunk {
34
type: 'text' | 'tool_call' | 'tool_result' | 'agent_step' | 'done' | 'error';
45
text?: string;

dist/providers/client.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/providers/client.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/providers/client.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/tools/executor.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/tools/executor.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)