import * as fs from "fs"; import Kronikarz from "../dist"; const k = new Kronikarz(__dirname + "/samples"); const dir = "./tmp/rss.xml"; test("generate RSS feed", () => { k.generateRss(dir, { title: "Test", feed_url: "https://site.com/rss.xml", site_url: "https://site.com" }); fs.readFile("./tmp/rss.xml", "utf-8", (err, data) => { expect(data).toBe(`<![CDATA[Test]]>https://site.comRSS for NodeFri, 07 Aug 2020 19:53:08 GMT<![CDATA[Test]]>

Test

12-12-2019 | Tester

test test test

]]>
https://site.com/kronika/2019/12/12/test/kronika/2019/12/12/testThu, 12 Dec 2019 00:00:00 GMT
<![CDATA[Category]]>

Category

01-01-2020 | Tester

This file is for testing categories

]]>
https://site.com/kronika/2019/12/12/category/kronika/2019/12/12/categoryThu, 12 Dec 2019 00:00:00 GMT
`); }); });