diff options
author | Alan Pearce | 2017-07-03 21:39:43 +0200 |
---|---|---|
committer | Alan Pearce | 2017-07-03 21:55:41 +0200 |
commit | e7b08b1dfe3f2a2596deb6e2a72bb79805d3708f (patch) | |
tree | 027fda29fe96736d4ac641a1dfe0bfe657d3fd33 /test/domain | |
parent | a67e38d1a82c95db5bd24183e81b31438f60dd2c (diff) | |
download | homestead-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.js | 28 |
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") ); |