diff options
author | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2020-01-03 00:24:34 +0100 |
---|---|---|
committer | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2020-01-03 00:24:34 +0100 |
commit | c11d7a84aa59e9b1179a9834129b2d776bab8bca (patch) | |
tree | c5c053ace0b8fca3c74fee360036bf1e2efd1c2c /test/generateApi.spec.ts | |
parent | 7b8d75cd87e392d9ffb3defa538a041c4f7e0f0c (diff) | |
download | kronikarz-c11d7a84aa59e9b1179a9834129b2d776bab8bca.tar.gz kronikarz-c11d7a84aa59e9b1179a9834129b2d776bab8bca.zip |
Add post endpoints
Diffstat (limited to 'test/generateApi.spec.ts')
-rw-r--r-- | test/generateApi.spec.ts | 13 |
1 files changed, 13 insertions, 0 deletions
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"); + }); +}); |