diff options
author | Alan Pearce | 2017-06-18 12:35:49 +0200 |
---|---|---|
committer | Alan Pearce | 2017-06-18 12:35:49 +0200 |
commit | bf20f4f6d97b8d2643f19ed7ac617c33a7f2ea6b (patch) | |
tree | f93779b36b3e2bc31126b467f0a16ababa79cd78 /test/modules | |
parent | 75ef26ea24032c7e8a6a5d63e65c70d43c88a938 (diff) | |
download | homestead-bf20f4f6d97b8d2643f19ed7ac617c33a7f2ea6b.tar.lz homestead-bf20f4f6d97b8d2643f19ed7ac617c33a7f2ea6b.tar.zst homestead-bf20f4f6d97b8d2643f19ed7ac617c33a7f2ea6b.zip |
refactor: metadata -> posts
Diffstat (limited to 'test/modules')
-rw-r--r-- | test/modules/posts.test.js (renamed from test/modules/metadata.test.js) | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/test/modules/metadata.test.js b/test/modules/posts.test.js index f154eac..28a25f2 100644 --- a/test/modules/metadata.test.js +++ b/test/modules/posts.test.js @@ -1,9 +1,9 @@ const test = require('ava') const path = require('path') -const metadata = require('../../src/modules/metadata.js') +const posts = require('../../src/modules/posts.js') -test('getFileMetadata', t => { +test('get', t => { const expected = new Map( Object.entries({ title: 'This is a test', @@ -11,13 +11,11 @@ test('getFileMetadata', t => { tags: ['a', 'b'] }) ) - const meta = metadata.getFileMetadata( - path.resolve(__dirname, '../data/testfile.md') - ) + const meta = posts.get(path.resolve(__dirname, '../data/testfile.md')) t.deepEqual(meta.data, expected) }) -test('getFolderMetadata', t => { +test('getFolder', t => { const expected = new Map( Object.entries({ title: 'This is a test', @@ -25,7 +23,7 @@ test('getFolderMetadata', t => { tags: ['a', 'b'] }) ) - const actual = metadata.getFolderMetadata(path.resolve(__dirname, '../data/')) + const actual = posts.getFolder(path.resolve(__dirname, '../data/')) t.true(Array.isArray(actual), 'must return an array') t.true(actual.length > 0, 'must return a non-empty array') t.is(actual[0].path, path.resolve(__dirname, '../data/testfile.md')) |