diff options
author | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2021-01-10 09:02:27 +0100 |
---|---|---|
committer | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2021-01-10 09:02:27 +0100 |
commit | 61a831565a49be3daafd4cb523caa1d2823a2b59 (patch) | |
tree | a050462496e8cc24ddfb9f2799480c5c9d034af5 /test/generatePages.spec.ts | |
parent | 88c1e8f2621612e146740536b7d82c697b5251a1 (diff) | |
download | kronikarz-61a831565a49be3daafd4cb523caa1d2823a2b59.tar.gz kronikarz-61a831565a49be3daafd4cb523caa1d2823a2b59.zip |
Add generatePages
Diffstat (limited to 'test/generatePages.spec.ts')
-rw-r--r-- | test/generatePages.spec.ts | 13 |
1 files changed, 13 insertions, 0 deletions
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); + }); +}) |