From 61a831565a49be3daafd4cb523caa1d2823a2b59 Mon Sep 17 00:00:00 2001 From: Patryk Niedźwiedziński Date: Sun, 10 Jan 2021 09:02:27 +0100 Subject: Add generatePages --- test/generatePages.spec.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 test/generatePages.spec.ts (limited to 'test') diff --git a/test/generatePages.spec.ts b/test/generatePages.spec.ts new file mode 100644 index 0000000..2312e48 --- /dev/null +++ b/test/generatePages.spec.ts @@ -0,0 +1,13 @@ +import * as fs from "fs"; +import Kronikarz from "../dist"; + +const k = new Kronikarz(__dirname + "/samples"); +const dir = "./tmp"; + +test("generate pages", () => { + k.generateApi(dir); + fs.readFile("./tmp/api/page/1.json", "utf-8", (err, data) => { + const page = JSON.parse(data); + expect(page.posts.length).toBe(2); + }); +}) -- cgit 1.4.1