pi-ext
bugabingas pi extensions
owned by bugabinga
test(overkill): use native paths on windows
fe3fc3b43de6cc6f0ca2b1c762d789e3e50d5027
Oliver Krylow <o.krylow@isp-insoft.de> ·
unsigned
Browse filesCompare with HEAD
Changed files (2)
extensions/overkill/__tests__/acceptance.test.ts
Modified535 535 expect(stdoutWrites.
length).
toBeGreaterThan(
0);
536 536 expect(stdoutWrites.
every((write)
=> write.fd
=== 1)).
toBe(
true);
537 537 const output
= stdoutWrites.
map((write)
=> write.
text).
join(
"");
538 + const runId
= branchEntries().
at(
-1)?.
data.runId;
539 + const directory
= join(data.agentDir,
"overkill-runs", runId);
538 540 expect(output).
toContain(
"Overkill baseline");
539 541 expect(output).
toContain(
`Source: ${data.skill}`);
540 - expect(output).
toMatch(
/Report: \/.*\/report\.json/u);
541 - expect(output).
toMatch(
/Staged: \/.*\/staged-skill\.md/u);
542 + expect(output).
toContain(
`Report: ${join(directory, "report.json")}`);
543 + expect(output).
toContain(
`Staged: ${join(directory, "staged-skill.md")}`);
542 544 const diff
= output.
slice(output.
lastIndexOf(
`--- ${data.skill}`));
543 545 expect(diff).
toContain(
"…[diff truncated]");
544 546 expect(diff.
split(
"\n").
length).
toBeLessThanOrEqual(
201);
extensions/overkill/__tests__/aftermath-harvest.test.ts
Modified 1 +import { resolve }
from "node:path";
1 2 import { describe, expect, it }
from "vitest";
8 9 describe(
"Aftermath harvest contracts", ()
=> {
9 10 it(
"uses active-branch order, text blocks, recognized paths, skill blocks, and follow-ups", ()
=> {
11 + const cwd
= resolve(
"/work");
12 + const skillPath
= resolve(
"/skills/lazy/SKILL.md");
10 13 const digest
= buildDigest({
20 - '<skill name="lazy" location="/skills/lazy/SKILL.md">\nbody\n</skill>\n\nDo it',
22 + content:
`<skill name="lazy" location="${skillPath}">\nbody\n</skill>\n\nDo it`,
38 - arguments: {
path:
"/skills/lazy/SKILL.md" },
40 + arguments: {
path: skillPath },
52 - knownSkillPaths:
new Map([[
"/skills/lazy/SKILL.md",
"lazy"]]),
54 + knownSkillPaths:
new Map([[skillPath,
"lazy"]]),
54 56 expect(digest).
toMatchObject({
57 59 userPrompts: [expect.
stringContaining(
"skill"),
"Thanks"],
58 60 assistantResponses: [
"Working"],
59 61 toolNames: [
"read",
"read"],
60 - touchedPaths: [
"/work/src/a.ts",
"/skills/lazy/SKILL.md"],
62 + touchedPaths: [
resolve(cwd,
"src/a.ts"), skillPath],
61 63 skillActivations: [
"lazy",
"lazy"],
62 64 followUps: [
"Thanks"],