diff --git a/test/emitter.test.ts b/test/emitter.test.ts index 67b31e1..db0d4c7 100644 --- a/test/emitter.test.ts +++ b/test/emitter.test.ts @@ -2,6 +2,7 @@ import { describe, expect, it } from "vitest"; import path from "node:path"; import fs from "node:fs/promises"; import { tmpdir } from "node:os"; +import type { FullSlug, FilePath } from "@quartz-community/types"; import { ExampleEmitter } from "../src/emitter"; import { createCtx, createProcessedContent } from "./helpers"; @@ -13,8 +14,8 @@ describe("ExampleEmitter", () => { const content = [ createProcessedContent({ - slug: "hello-world", - filePath: "notes/hello-world.md", + slug: "hello-world" as FullSlug, + filePath: "notes/hello-world.md" as FilePath, frontmatter: { title: "Hello", tags: ["docs"] }, }), ]; diff --git a/test/filter.test.ts b/test/filter.test.ts index 514069a..1cb34d3 100644 --- a/test/filter.test.ts +++ b/test/filter.test.ts @@ -6,7 +6,7 @@ describe("ExampleFilter", () => { it("filters drafts by default", () => { const ctx = createCtx(); const filter = ExampleFilter(); - const content = createProcessedContent({ frontmatter: { draft: true } }); + const content = createProcessedContent({ frontmatter: { title: "Test", draft: true } }); expect(filter.shouldPublish(ctx, content)).toBe(false); }); @@ -14,7 +14,7 @@ describe("ExampleFilter", () => { it("allows drafts when configured", () => { const ctx = createCtx(); const filter = ExampleFilter({ allowDrafts: true }); - const content = createProcessedContent({ frontmatter: { draft: true } }); + const content = createProcessedContent({ frontmatter: { title: "Test", draft: true } }); expect(filter.shouldPublish(ctx, content)).toBe(true); });