summary refs log tree commit diff
path: root/test/generatePages.spec.ts
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2021-01-10 09:05:43 +0100
committerGitHub <noreply@github.com>2021-01-10 09:05:43 +0100
commitb358a212fda6be6c43eb864979e1c58bd6f5200e (patch)
tree36a0858f99424571bf9fba978a1ae6a3a12af352 /test/generatePages.spec.ts
parent01f77f86cea0a6b2b7b74b2105720ee7142d6767 (diff)
parent3bbeb33e6df1aac21ec2e92931f4628b992f4013 (diff)
downloadkronikarz-b358a212fda6be6c43eb864979e1c58bd6f5200e.tar.gz
kronikarz-b358a212fda6be6c43eb864979e1c58bd6f5200e.zip
Merge pull request #22 from pniedzwiedzinski/pages v2.3.0
Pages
Diffstat (limited to 'test/generatePages.spec.ts')
-rw-r--r--test/generatePages.spec.ts13
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);
+  });
+})