From c11d7a84aa59e9b1179a9834129b2d776bab8bca Mon Sep 17 00:00:00 2001 From: Patryk Niedźwiedziński Date: Fri, 3 Jan 2020 00:24:34 +0100 Subject: Add post endpoints --- test/generateApi.spec.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 test/generateApi.spec.ts (limited to 'test') diff --git a/test/generateApi.spec.ts b/test/generateApi.spec.ts new file mode 100644 index 0000000..c2a96e3 --- /dev/null +++ b/test/generateApi.spec.ts @@ -0,0 +1,13 @@ +import * as fs from "fs"; +import Kronikarz from "../dist"; + +const k = new Kronikarz(__dirname + "/samples"); + +test("generate single file", () => { + const dir = "./tmp"; + k.generateApi(dir); + fs.readFile("./tmp/api/posts/2019/12/12/test.json", "utf-8", (err, data) => { + const parsedPost = JSON.parse(data); + expect(parsedPost.title).toBe("test"); + }); +}); -- cgit 1.4.1