summary refs log tree commit diff stats
path: root/test/domain/posts.test.js
diff options
context:
space:
mode:
authorAlan Pearce2017-07-02 15:30:20 +0200
committerAlan Pearce2017-07-02 15:30:20 +0200
commitb7bf162e6c3bc834097e65936704e3eac59eb4bd (patch)
tree9f080d9c67d6ee17a506e5ab52761f22b649137c /test/domain/posts.test.js
parent2d931962b74fe06c1bfbc2454fa166d24e8e2f59 (diff)
downloadhomestead-b7bf162e6c3bc834097e65936704e3eac59eb4bd.tar.lz
homestead-b7bf162e6c3bc834097e65936704e3eac59eb4bd.tar.zst
homestead-b7bf162e6c3bc834097e65936704e3eac59eb4bd.zip
feat: Use microformats classes
Add snapshot-based tests to ensure microformats data can be extracted
correctly.
Diffstat (limited to 'test/domain/posts.test.js')
-rw-r--r--test/domain/posts.test.js18
1 files changed, 11 insertions, 7 deletions
diff --git a/test/domain/posts.test.js b/test/domain/posts.test.js
index cc236c7..8b27698 100644
--- a/test/domain/posts.test.js
+++ b/test/domain/posts.test.js
@@ -1,13 +1,16 @@
 const test = require("ava");
 const path = require("path");
 
-const Posts = require("../../src/domain/posts.js")({
-  folder: path.resolve(__dirname, "../testsite/posts/"),
-  taxonomies: {
-    tag: "tags",
-    category: "categories"
-  }
-});
+const Posts = require("../../src/domain/posts.js")(
+  {
+    folder: path.resolve(__dirname, "../testsite/posts/"),
+    taxonomies: {
+      tag: "tags",
+      category: "categories"
+    }
+  },
+  basename => basename
+);
 
 test("get", t => {
   const expected = new Map(
@@ -19,6 +22,7 @@ test("get", t => {
     })
   );
   const post = Posts.get(
+    basename => basename,
     path.resolve(__dirname, "../testsite/posts/testfile.md")
   );
   t.deepEqual(post.data, expected);