mirror of
https://github.com/grafana/grafana.git
synced 2025-02-16 18:34:52 -06:00
* Add and configure eslint-plugin-import * Fix the lint:ts npm command * Autofix + prettier all the files * Manually fix remaining files * Move jquery code in jest-setup to external file to safely reorder imports * Resolve issue caused by circular dependencies within Prometheus * Update .betterer.results * Fix missing // @ts-ignore * ignore iconBundle.ts * Fix missing // @ts-ignore
16 lines
657 B
TypeScript
16 lines
657 B
TypeScript
import fs from 'fs';
|
|
|
|
import { parseRSSFeed } from './rss';
|
|
|
|
describe('RSS feed parser', () => {
|
|
it('should successfully parse an rss feed', async () => {
|
|
const rssFile = fs.readFileSync(`${__dirname}/fixtures/rss.xml`, 'utf8');
|
|
const parsedFeed = parseRSSFeed(rssFile);
|
|
expect(parsedFeed.items).toHaveLength(1);
|
|
expect(parsedFeed.items[0].title).toBe('A fake item');
|
|
expect(parsedFeed.items[0].link).toBe('https://www.example.net/2022/02/10/something-fake/');
|
|
expect(parsedFeed.items[0].pubDate).toBe('Thu, 10 Feb 2022 16:00:17 +0000');
|
|
expect(parsedFeed.items[0].content).toBe('A description of a fake blog post');
|
|
});
|
|
});
|