From b7bf162e6c3bc834097e65936704e3eac59eb4bd Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 2 Jul 2017 15:30:20 +0200 Subject: feat: Use microformats classes Add snapshot-based tests to ensure microformats data can be extracted correctly. --- test/domain/posts.test.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'test/domain') 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); -- cgit 1.4.1