38 lines
888 B
TypeScript
38 lines
888 B
TypeScript
import { describe, expect, test } from "bun:test";
|
|
import { parseAgentFields } from "../../src/discovery/helpers";
|
|
|
|
describe("parseAgentFields", () => {
|
|
test("parses blocking from boolean frontmatter", () => {
|
|
const fields = parseAgentFields({
|
|
name: "reviewer",
|
|
description: "desc",
|
|
blocking: true,
|
|
});
|
|
|
|
expect(fields).toBeDefined();
|
|
expect(fields?.blocking).toBe(true);
|
|
});
|
|
|
|
test("parses blocking from string frontmatter", () => {
|
|
const fields = parseAgentFields({
|
|
name: "reviewer",
|
|
description: "desc",
|
|
blocking: "false",
|
|
});
|
|
|
|
expect(fields).toBeDefined();
|
|
expect(fields?.blocking).toBe(false);
|
|
});
|
|
|
|
test("ignores invalid blocking values", () => {
|
|
const fields = parseAgentFields({
|
|
name: "reviewer",
|
|
description: "desc",
|
|
blocking: "sometimes",
|
|
});
|
|
|
|
expect(fields).toBeDefined();
|
|
expect(fields?.blocking).toBeUndefined();
|
|
});
|
|
});
|