summary refs log tree commit diff
path: root/test/generateApi.spec.ts
blob: c2a96e3c19c0b52434fe80cccd58a5025c10f231 (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");
  });
});