diff --git a/src/index.test.ts b/src/index.test.ts index e19b777..3de09e1 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -47,7 +47,7 @@ test("Kill the Newsletter!", async () => { const feedReference = create.match(/\/feeds\/([a-z0-9]{16})\.xml/)![1]; // Test feed properties - let feedOriginal = await webClient.get(`feeds/${feedReference}.xml`); + const feedOriginal = await webClient.get(`feeds/${feedReference}.xml`); expect(feedOriginal.headers["content-type"]).toMatch("application/atom+xml"); expect(feedOriginal.headers["x-robots-tag"]).toBe("noindex"); expect(feedOriginal.body).toMatch(html`
Some HTML
`, }); - let feed = (await webClient.get(`feeds/${feedReference}.xml`)).body; + const feed = (await webClient.get(`feeds/${feedReference}.xml`)).body; expect(feed.match(/Some HTML
`}\nSome plain text
`}A link: https://kill-the-newsletter.com
`}A link: https://kill-the-newsletter.com
`}Invalid XML character (backspace): |\b|π©
", - }); - const feed = await getFeed(identifier); - const entry = feed.querySelector("feed > entry:first-of-type")!; - expect(entry.querySelector("content")!.textContent).toMatchInlineSnapshot(` - "Invalid XML character (backspace): ||π©
- " - `); - }); - - test("invalid XML character in text", async () => { - const identifier = await createFeed(); - await emailClient.sendMail({ - from: "publisher@example.com", - to: `${identifier}@${EMAIL_DOMAIN}`, - subject: "New Message", - text: "Invalid XML character (backspace): |\b|π©", - }); - const feed = await getFeed(identifier); - const entry = feed.querySelector("feed > entry:first-of-type")!; - expect(entry.querySelector("content")!.textContent).toMatchInlineSnapshot( - `"Invalid XML character (backspace): ||💩
"` - ); - }); - test("missing βfromβ", async () => { const identifier = await createFeed(); await emailClient.sendMail({