summary refs log tree commit diff
path: root/test/generateApi.spec.ts
blob: bf63b6e1f4b65841a856b6310f5d4382f5929329 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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");
  });
});