mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 10:05:14 +00:00
55 lines
1.4 KiB
TypeScript
55 lines
1.4 KiB
TypeScript
import { describe, expect, test } from "vitest";
|
|
import { buildSystemPrompt } from "../src/core/system-prompt.js";
|
|
|
|
describe("buildSystemPrompt", () => {
|
|
describe("empty tools", () => {
|
|
test("shows (none) for empty tools list", () => {
|
|
const prompt = buildSystemPrompt({
|
|
selectedTools: [],
|
|
contextFiles: [],
|
|
skills: [],
|
|
});
|
|
|
|
expect(prompt).toContain("Available tools:\n(none)");
|
|
});
|
|
|
|
test("shows file paths guideline even with no tools", () => {
|
|
const prompt = buildSystemPrompt({
|
|
selectedTools: [],
|
|
contextFiles: [],
|
|
skills: [],
|
|
});
|
|
|
|
expect(prompt).toContain("Show file paths clearly");
|
|
});
|
|
});
|
|
|
|
describe("default tools", () => {
|
|
test("includes all default tools", () => {
|
|
const prompt = buildSystemPrompt({
|
|
contextFiles: [],
|
|
skills: [],
|
|
});
|
|
|
|
expect(prompt).toContain("- read:");
|
|
expect(prompt).toContain("- bash:");
|
|
expect(prompt).toContain("- edit:");
|
|
expect(prompt).toContain("- write:");
|
|
});
|
|
});
|
|
|
|
describe("custom tool snippets", () => {
|
|
test("includes custom tools in available tools section", () => {
|
|
const prompt = buildSystemPrompt({
|
|
selectedTools: ["read", "dynamic_tool"],
|
|
toolSnippets: {
|
|
dynamic_tool: "Run dynamic test behavior",
|
|
},
|
|
contextFiles: [],
|
|
skills: [],
|
|
});
|
|
|
|
expect(prompt).toContain("- dynamic_tool: Run dynamic test behavior");
|
|
});
|
|
});
|
|
});
|