diff options
author | Alan Pearce | 2017-07-02 15:30:20 +0200 |
---|---|---|
committer | Alan Pearce | 2017-07-02 15:30:20 +0200 |
commit | b7bf162e6c3bc834097e65936704e3eac59eb4bd (patch) | |
tree | 9f080d9c67d6ee17a506e5ab52761f22b649137c /test/domain | |
parent | 2d931962b74fe06c1bfbc2454fa166d24e8e2f59 (diff) | |
download | homestead-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')
-rw-r--r-- | test/domain/posts.test.js | 18 |
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); |