all repos — archive/homestead @ 7bf25f232569aa62edf1c88e7014a9f3c1b37014

My future indieweb platform

feat: Create feed handler for root

Alan Pearce
commit

7bf25f232569aa62edf1c88e7014a9f3c1b37014

parent

a62fb1e7584ffa53a256ff8ce4d6a451ca542f20

1 file changed, 13 insertions(+), 0 deletions(-)

changed files
M test/app.test.jstest/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/);