about summary refs log tree commit diff stats
path: root/test/domain
diff options
context:
space:
mode:
authorAlan Pearce2017-07-03 21:39:43 +0200
committerAlan Pearce2017-07-03 21:55:41 +0200
commite7b08b1dfe3f2a2596deb6e2a72bb79805d3708f (patch)
tree027fda29fe96736d4ac641a1dfe0bfe657d3fd33 /test/domain
parenta67e38d1a82c95db5bd24183e81b31438f60dd2c (diff)
downloadhomestead-e7b08b1dfe3f2a2596deb6e2a72bb79805d3708f.tar.lz
homestead-e7b08b1dfe3f2a2596deb6e2a72bb79805d3708f.tar.zst
homestead-e7b08b1dfe3f2a2596deb6e2a72bb79805d3708f.zip
feat: Add code block highlighting
Theme is configurable
Diffstat (limited to 'test/domain')
-rw-r--r--test/domain/posts.test.js28
1 files changed, 16 insertions, 12 deletions
diff --git a/test/domain/posts.test.js b/test/domain/posts.test.js
index 8b27698..bb97361 100644
--- a/test/domain/posts.test.js
+++ b/test/domain/posts.test.js
@@ -1,18 +1,22 @@
 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"
-    }
-  },
-  basename => basename
-);
+const Posts = require("../../src/domain/posts.js");
 
-test("get", t => {
+test.beforeEach(async t => {
+  t.context = await Posts(
+    {
+      folder: path.resolve(__dirname, "../testsite/posts/"),
+      taxonomies: {
+        tag: "tags",
+        category: "categories"
+      }
+    },
+    basename => basename
+  );
+});
+
+test("get", async t => {
   const expected = new Map(
     Object.entries({
       title: "This is a test",
@@ -21,7 +25,7 @@ test("get", t => {
       tags: ["a", "b"]
     })
   );
-  const post = Posts.get(
+  const post = await t.context.get(
     basename => basename,
     path.resolve(__dirname, "../testsite/posts/testfile.md")
   );