@agentdesk/workflows-mcp
Version:
MCP workflow orchestration tool with presets for thinking, coding and more
114 lines • 4.86 kB
JavaScript
import { expect } from "chai";
import { debuggerPrompt, architecturePrompt, plannerPrompt, prdPrompt, prReviewPrompt, saveForLaterPrompt, } from "../prompts.js";
describe("Prompt Functions", () => {
describe("debuggerPrompt", () => {
it("should return default prompt when no config is provided", () => {
const prompt = debuggerPrompt();
expect(prompt).to.include("# Debugger Mode");
expect(prompt).to.include("Debugging Process");
});
it("should use custom prompt when provided", () => {
const config = {
debugger_mode: {
customPrompt: "# Custom Debugger Prompt",
},
};
const prompt = debuggerPrompt(config);
expect(prompt).to.include("# Custom Debugger Prompt");
expect(prompt).not.to.include("Debugging Process");
});
it("should append additional context when provided", () => {
const config = {
debugger_mode: {
additionalContext: "This is additional context.",
},
};
const prompt = debuggerPrompt(config);
expect(prompt).to.include("# Debugger Mode");
expect(prompt).to.include("This is additional context.");
});
it("should add tools in situational mode", () => {
const config = {
debugger_mode: {
availableTools: [
{ name: "tool1", description: "Tool 1 description" },
{ name: "tool2", description: "Tool 2 description" },
],
toolMode: "situational",
},
};
const prompt = debuggerPrompt(config);
expect(prompt).to.include("## Available Tools");
expect(prompt).to.include("You can use these tools as needed");
expect(prompt).to.include("tool1");
expect(prompt).to.include("tool2");
expect(prompt).to.include("Tool 1 description");
});
it("should add tools in sequential mode", () => {
const config = {
debugger_mode: {
availableTools: [
{ name: "tool1", description: "Tool 1 description" },
{ name: "tool2", description: "Tool 2 description" },
],
toolMode: "sequential",
},
};
const prompt = debuggerPrompt(config);
expect(prompt).to.include("## Available Tools");
expect(prompt).to.include("Follow this sequence of tools");
expect(prompt).to.include("1. **tool1**");
expect(prompt).to.include("2. **tool2**");
});
});
describe("architecturePrompt", () => {
it("should return default prompt when no config is provided", () => {
const prompt = architecturePrompt();
expect(prompt).to.include("# Architecture Mode");
});
it("should use custom prompt when provided", () => {
const config = {
architecture_mode: {
customPrompt: "# Custom Architecture Prompt",
},
};
const prompt = architecturePrompt(config);
expect(prompt).to.include("# Custom Architecture Prompt");
});
});
// Test the other prompt functions similarly
describe("plannerPrompt", () => {
it("should return default prompt when no config is provided", () => {
const prompt = plannerPrompt();
expect(prompt).to.include("# Planner Mode");
});
it("should use custom prompt when provided", () => {
const config = {
planner_mode: {
customPrompt: "# Custom Planner Prompt",
},
};
const prompt = plannerPrompt(config);
expect(prompt).to.include("# Custom Planner Prompt");
});
});
describe("prdPrompt", () => {
it("should return default prompt when no config is provided", () => {
const prompt = prdPrompt();
expect(prompt).to.include("# Product Requirements Document");
});
});
describe("prReviewPrompt", () => {
it("should return default prompt when no config is provided", () => {
const prompt = prReviewPrompt();
expect(prompt).to.include("# PR Review Mode");
});
});
describe("saveForLaterPrompt", () => {
it("should return default prompt when no config is provided", () => {
const prompt = saveForLaterPrompt();
expect(prompt).to.include("# Save For Later");
});
});
});
//# sourceMappingURL=prompts.test.js.map