24 lines
800 B
TypeScript
24 lines
800 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { parseProjectConfig } from "./parseProjectConfig";
|
|
import { serializeProjectConfig } from "./serializeProjectConfig";
|
|
|
|
describe("serializeProjectConfig", () => {
|
|
it("round-trips tags", () => {
|
|
const yaml = serializeProjectConfig({ tags: ["bug", "docs"] });
|
|
expect(yaml).toContain("bug");
|
|
expect(yaml).toContain("docs");
|
|
const parsed = parseProjectConfig(yaml);
|
|
expect(parsed.isOk()).toBe(true);
|
|
if (parsed.isErr()) return;
|
|
expect(parsed.value.tags).toEqual(["bug", "docs"]);
|
|
});
|
|
|
|
it("serializes empty tags", () => {
|
|
const yaml = serializeProjectConfig({ tags: [] });
|
|
const parsed = parseProjectConfig(yaml);
|
|
expect(parsed.isOk()).toBe(true);
|
|
if (parsed.isErr()) return;
|
|
expect(parsed.value.tags).toEqual([]);
|
|
});
|
|
});
|