Files
smartsitemap/test/test.ts

26 lines
777 B
TypeScript
Raw Normal View History

2023-07-27 16:16:37 +02:00
import { expect, tap } from '@push.rocks/tapbundle';
2022-03-25 00:14:34 +01:00
import * as smartsitemap from '../ts/index.js';
2020-10-25 22:12:38 +00:00
let testSmartsitemap: smartsitemap.SmartSitemap;
tap.test('should create an instance of Smartsitemap', async () => {
testSmartsitemap = new smartsitemap.SmartSitemap();
2022-03-25 00:14:34 +01:00
expect(testSmartsitemap).toBeInstanceOf(smartsitemap.SmartSitemap);
2020-10-25 22:12:38 +00:00
});
2020-10-26 00:52:04 +00:00
tap.test('should create a sitemap from feed', async () => {
2023-07-27 16:16:37 +02:00
const sitemapString = await testSmartsitemap.createSitemapNewsFromFeedUrl(
'https://coffee.link/rss/',
2023-07-27 16:16:37 +02:00
);
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 () => {
const result = await testSmartsitemap.parseSitemapUrl(
'https://www.theverge.com/sitemaps/google_news',
);
2023-07-27 16:16:37 +02:00
// console.log(result.urlset.url);
});
2021-01-03 02:08:00 +00:00
2020-10-25 22:12:38 +00:00
tap.start();