diff options
author | Alan Pearce | 2017-06-30 17:37:20 +0200 |
---|---|---|
committer | Alan Pearce | 2017-06-30 17:37:20 +0200 |
commit | 562b0533300ad5ad8cf4695aa7fc2b844b918169 (patch) | |
tree | 96ab4a7e838d4e7d8b06fc08eaa351ba58992721 /test/domain | |
parent | 136ebe22452c0015770d9f0ac9d94d8941461816 (diff) | |
download | homestead-562b0533300ad5ad8cf4695aa7fc2b844b918169.tar.lz homestead-562b0533300ad5ad8cf4695aa7fc2b844b918169.tar.zst homestead-562b0533300ad5ad8cf4695aa7fc2b844b918169.zip |
feat: load config from cwd and merge with defaults
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"); +}); |