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 () => {
|
2021-01-03 02:48:45 +00:00
|
|
|
const sitemapString = await testSmartsitemap.createSitemapNewsFromFeedUrl('https://central.eu/feed');
|
2020-10-26 00:52:04 +00:00
|
|
|
console.log(sitemapString);
|
|
|
|
});
|
|
|
|
|
2021-01-03 02:08:00 +00:00
|
|
|
tap.test('should parse a sitemap', async () => {
|
2021-01-03 02:48:45 +00:00
|
|
|
const result = await testSmartsitemap.parseSitemapUrl('https://central.eu/sitemap-news');
|
|
|
|
console.log(result.urlset.url);
|
2021-01-03 02:08:00 +00:00
|
|
|
})
|
|
|
|
|
2020-10-25 22:12:38 +00:00
|
|
|
tap.start();
|