From e7b08b1dfe3f2a2596deb6e2a72bb79805d3708f Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 3 Jul 2017 21:39:43 +0200 Subject: feat: Add code block highlighting Theme is configurable --- test/domain/posts.test.js | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'test/domain') 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") ); -- cgit 1.4.1