feat: Create feed handler for root
1 file changed, 13 insertions(+), 0 deletions(-)
changed files
M test/app.test.js → test/app.test.js
@@ -169,5 +169,18 @@ t.is(res.charset, "utf-8"); 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/);