mirror of
https://github.com/samiyev/puaros.git
synced 2025-12-27 23:06:54 +05:00
feat(ipuaro): implement v0.1.0 foundation
- Project setup with tsup, vitest, ESM support - Domain entities: Session, Project - Value objects: FileData, FileAST, FileMeta, ChatMessage, ToolCall, ToolResult, UndoEntry - Service interfaces: IStorage, ILLMClient, ITool, IIndexer, IToolRegistry - Shared: Config (zod), IpuaroError, utils (hash, tokens), Result type - CLI with placeholder commands (start, init, index) - 91 unit tests with 100% coverage - Fix package scope @puaros -> @samiyev in CLAUDE.md
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import { describe, it, expect } from "vitest"
|
||||
import {
|
||||
createSuccessResult,
|
||||
createErrorResult,
|
||||
} from "../../../../src/domain/value-objects/ToolResult.js"
|
||||
|
||||
describe("ToolResult", () => {
|
||||
describe("createSuccessResult", () => {
|
||||
it("should create success result", () => {
|
||||
const data = { lines: ["line1", "line2"] }
|
||||
const result = createSuccessResult("call-1", data, 50)
|
||||
|
||||
expect(result.callId).toBe("call-1")
|
||||
expect(result.success).toBe(true)
|
||||
expect(result.data).toEqual(data)
|
||||
expect(result.executionTimeMs).toBe(50)
|
||||
expect(result.error).toBeUndefined()
|
||||
})
|
||||
})
|
||||
|
||||
describe("createErrorResult", () => {
|
||||
it("should create error result", () => {
|
||||
const result = createErrorResult("call-2", "File not found", 10)
|
||||
|
||||
expect(result.callId).toBe("call-2")
|
||||
expect(result.success).toBe(false)
|
||||
expect(result.error).toBe("File not found")
|
||||
expect(result.executionTimeMs).toBe(10)
|
||||
expect(result.data).toBeUndefined()
|
||||
})
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user