smartsitemap/test/test.ts

19 lines
655 B
TypeScript
Raw Normal View History

2020-10-25 22:12:38 +00:00
import { expect, tap } from '@pushrocks/tapbundle';
import * as smartsitemap from '../ts/index';
let testSmartsitemap: smartsitemap.SmartSitemap;
tap.test('should create an instance of Smartsitemap', async () => {
testSmartsitemap = new smartsitemap.SmartSitemap();
expect(testSmartsitemap).to.be.instanceOf(smartsitemap.SmartSitemap);
});
2020-10-26 00:52:04 +00:00
tap.test('should create a sitemap from feed', async () => {
const sitemapNews = testSmartsitemap.createSmartsitemapNews();
await sitemapNews.readFromRssFeed('https://www.theverge.com/rss/index.xml');
const sitemapString = sitemapNews.exportSitemapXml();
console.log(sitemapString);
});
2020-10-25 22:12:38 +00:00
tap.start();