From 49e82e812812ba75175d98173379d2e416e17b8f Mon Sep 17 00:00:00 2001 From: Patryk Niedźwiedziński Date: Mon, 14 Oct 2019 09:47:28 +0200 Subject: Add getPost --- test/getPost.spec.ts | 8 ++++++++ test/index.spec.ts | 6 ++++++ test/samples/2019/12/12/test.md | 11 +++++++++++ 3 files changed, 25 insertions(+) create mode 100644 test/getPost.spec.ts create mode 100644 test/index.spec.ts create mode 100644 test/samples/2019/12/12/test.md (limited to 'test') diff --git a/test/getPost.spec.ts b/test/getPost.spec.ts new file mode 100644 index 0000000..6a5e4e0 --- /dev/null +++ b/test/getPost.spec.ts @@ -0,0 +1,8 @@ +import Kronikarz from "../dist"; + +const k = new Kronikarz(__dirname + "/samples"); + +test("simple get", () => { + const post = k.getPost("2019", "12", "12", "test"); + expect(post.content.meta["title"]).toBe("Test"); +}); diff --git a/test/index.spec.ts b/test/index.spec.ts new file mode 100644 index 0000000..4fd65e1 --- /dev/null +++ b/test/index.spec.ts @@ -0,0 +1,6 @@ +import Kronikarz from "../dist"; + +test("basic", () => { + const k = new Kronikarz(__dirname + "/samples"); + expect(k.getPosts().length).toBe(1); +}); diff --git a/test/samples/2019/12/12/test.md b/test/samples/2019/12/12/test.md new file mode 100644 index 0000000..5fc0158 --- /dev/null +++ b/test/samples/2019/12/12/test.md @@ -0,0 +1,11 @@ +--- +title: Test +description: test test +author: Tester +--- + +# Test + +12-12-2019 | Tester + +test test test -- cgit 1.4.1