diff options
Diffstat (limited to 'test/domain')
-rw-r--r-- | test/domain/posts.test.js | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/test/domain/posts.test.js b/test/domain/posts.test.js index 8866f40..c433ce5 100644 --- a/test/domain/posts.test.js +++ b/test/domain/posts.test.js @@ -1,23 +1,25 @@ -const test = require('ava') -const path = require('path') +const test = require("ava"); +const path = require("path"); -const Posts = require('../../src/domain/posts.js')({ - folder: path.resolve('../data', __dirname), +const Posts = require("../../src/domain/posts.js")({ + folder: path.resolve(__dirname, "../testsite/posts/"), taxonomies: { - tag: 'tags', - category: 'categories' + tag: "tags", + category: "categories" } -}) +}); -test('get', t => { +test("get", t => { const expected = new Map( Object.entries({ - title: 'This is a test', - description: 'Test file', - tags: ['a', 'b'] + title: "This is a test", + description: "Test file", + tags: ["a", "b"] }) - ) - const post = Posts.get(path.resolve(__dirname, '../data/testfile.md')) - t.deepEqual(post.data, expected) - t.is(post.basename, 'testfile', 'must include basename') -}) + ); + const post = Posts.get( + path.resolve(__dirname, "../testsite/posts/testfile.md") + ); + t.deepEqual(post.data, expected); + t.is(post.basename, "testfile", "must include basename"); +}); |