diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/index.test.js | 8 | ||||
-rw-r--r-- | test/modules/posts.test.js | 5 |
2 files changed, 11 insertions, 2 deletions
diff --git a/test/index.test.js b/test/index.test.js index 897438c..a81dbb6 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -21,3 +21,11 @@ test('post', t => { .expect(/Lorem ipsum/) .then(() => t.pass()) }) + +test('tags', t => { + return request(app.listen()) + .get('/tags/a') + .expect(200) + .expect(/This is a test/) + .then(() => t.pass()) +}) diff --git a/test/modules/posts.test.js b/test/modules/posts.test.js index cdbf22a..4f1efb5 100644 --- a/test/modules/posts.test.js +++ b/test/modules/posts.test.js @@ -11,8 +11,9 @@ test('get', t => { tags: ['a', 'b'] }) ) - const meta = posts.get(path.resolve(__dirname, '../data/testfile.md')) - t.deepEqual(meta.data, expected) + const post = posts.get(path.resolve(__dirname, '../data/testfile.md')) + t.deepEqual(post.data, expected) + t.is(post.basename, 'testfile', 'must include basename') }) test('getFolder', t => { |