diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/app.test.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/app.test.js b/test/app.test.js index f0ab3da..33c8905 100644 --- a/test/app.test.js +++ b/test/app.test.js @@ -169,5 +169,18 @@ test("highlight css", async function(t) { t.regex(res.text, /^\.hljs/m); }); +test("feed", async function(t) { + const res = await request(app.listen()).get("/index.xml"); + + t.is(res.statusCode, 200); + t.is(res.type, "application/atom+xml"); + t.regex(res.text, /^<\?xml/); + + const $ = parseResponse(res); + + t.is($("feed > title").text(), "John Doe"); + t.is($("feed > link").attr("href"), "http://localhost:3000/"); +}); + test(notFound, "/post/non-existent", /Post not found/); test(notFound, "/tag/non-existent", /tag non-existent not found/); |