Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

RuntimeInstructions.test.ts

31 lines1.3 KB

1import { describe, expect, it } from "vite-plus/test";
2import { buildRuntimeInstructions } from "./RuntimeInstructions.ts";
3​
4describe("buildRuntimeInstructions", () => {
5 it.each(["Codex", "Claude Code", "Cursor", "Grok", "OpenCode", "Antigravity"])(
6 "identifies the %s harness and describes media embedding",
7 (harness) => {
8 const instructions = buildRuntimeInstructions({ harness });
9 expect(instructions).toContain(`running in T3 Code through the ${harness} harness.`);
10 expect(instructions).toContain("embed images and videos");
11 expect(instructions).toContain("Markdown with absolute file paths");
12 expect(instructions).not.toContain("undefined");
13 },
14 );
15​
16 it("keeps known model and effort metadata on one line", () => {
17 expect(
18 buildRuntimeInstructions({
19 harness: "Codex",
20 model: " custom\nmodel ",
21 reasoningEffort: " high\n",
22 }),
23 ).toContain("through the Codex harness, as custom model with high reasoning effort.");
24 });
25​
26 it.each([undefined, "", "auto", "default"])("omits unresolved model %s", (model) => {
27 const instructions = buildRuntimeInstructions({ harness: "Cursor", model });
28 expect(instructions).toContain("through the Cursor harness.");
29 expect(instructions).not.toContain("reasoning effort");
30 });
31});