diff options
Diffstat (limited to 'js/test')
| -rw-r--r-- | js/test/tool/tool.test.ts | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/js/test/tool/tool.test.ts b/js/test/tool/tool.test.ts new file mode 100644 index 000000000..4e9daf152 --- /dev/null +++ b/js/test/tool/tool.test.ts @@ -0,0 +1,37 @@ +import { describe, expect, test } from "bun:test"; +import { App } from "../../src/app"; +import { glob } from "../../src/tool/glob"; + +describe("tool.glob", () => { + test("truncate", async () => { + await App.provide({ directory: process.cwd() }, async () => { + let result = await glob.execute( + { + pattern: "./node_modules/**/*", + }, + { + toolCallId: "test", + messages: [], + }, + ); + expect(result.metadata.truncated).toBe(true); + }); + }); + test("basic", async () => { + await App.provide({ directory: process.cwd() }, async () => { + let result = await glob.execute( + { + pattern: "*.json", + }, + { + toolCallId: "test", + messages: [], + }, + ); + expect(result.metadata).toMatchObject({ + truncated: false, + count: 3, + }); + }); + }); +}); |
