FN-6172: fix skill diagnostics logger assertion

Update the skill diagnostics test to assert against the structured logger surface that now emits the diagnostics output.

- spy on piLog.log instead of piLog.warn in the structured logger diagnostics test
- keep the existing [skills] and [executor] assertions while matching the current logging path

Files changed:
 packages/engine/src/__tests__/pi-create-fn-agent.test.ts | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Fusion-Task-Id: FN-6172

Fusion-Task-Lineage: e52023f7-6c18-435d-b2c6-bd7f7024b75f
This commit is contained in:
gsxdsm
2026-06-09 23:26:13 -07:00
parent 827b7d934d
commit 1c875f1704

View File

@@ -2115,7 +2115,7 @@ describe("createFnAgent", () => {
it("diagnostics are logged via structured logger with [skills] context", async () => {
const { piLog } = await import("../logger.js");
const piWarnSpy = vi.spyOn(piLog, "warn").mockImplementation(() => {});
const piLogSpy = vi.spyOn(piLog, "log").mockImplementation(() => {});
// Test diagnostics logging by directly calling createSkillsOverrideFromSelection
const { createSkillsOverrideFromSelection } = await import("../skill-resolver.js");
@@ -2141,7 +2141,7 @@ describe("createFnAgent", () => {
expect(result.diagnostics.length).toBeGreaterThan(0);
// Check that diagnostics were logged with [skills] context
const skillLogs = piWarnSpy.mock.calls.filter(call =>
const skillLogs = piLogSpy.mock.calls.filter(call =>
String(call[0]).includes("[skills]")
);
expect(skillLogs.length).toBeGreaterThan(0);
@@ -2150,7 +2150,7 @@ describe("createFnAgent", () => {
const lastLog = skillLogs[skillLogs.length - 1][0] as string;
expect(lastLog).toContain("[executor]");
piWarnSpy.mockRestore();
piLogSpy.mockRestore();
});
});
});