track version on session info

This commit is contained in:
Dax Raad
2025-06-18 13:40:21 -04:00
parent b796d6763f
commit f99904bc1c
6 changed files with 51 additions and 19 deletions

View File

@@ -3,6 +3,12 @@ import { App } from "../../src/app/app"
import { GlobTool } from "../../src/tool/glob"
import { ListTool } from "../../src/tool/ls"
const ctx = {
sessionID: "test",
messageID: "",
abort: AbortSignal.any([]),
metadata: () => {},
}
describe("tool.glob", () => {
test("truncate", async () => {
await App.provide({ cwd: process.cwd() }, async () => {
@@ -11,11 +17,7 @@ describe("tool.glob", () => {
pattern: "./node_modules/**/*",
path: undefined,
},
{
sessionID: "test",
messageID: "",
abort: AbortSignal.any([]),
},
ctx,
)
expect(result.metadata.truncated).toBe(true)
})
@@ -27,11 +29,7 @@ describe("tool.glob", () => {
pattern: "*.json",
path: undefined,
},
{
sessionID: "test",
messageID: "",
abort: AbortSignal.any([]),
},
ctx,
)
expect(result.metadata).toMatchObject({
truncated: false,
@@ -46,11 +44,7 @@ describe("tool.ls", () => {
const result = await App.provide({ cwd: process.cwd() }, async () => {
return await ListTool.execute(
{ path: "./example", ignore: [".git"] },
{
sessionID: "test",
messageID: "",
abort: AbortSignal.any([]),
},
ctx,
)
})
expect(result.output).toMatchSnapshot()