mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
test: rss-parser
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { describe, expect, it } from '@jest/globals';
|
||||
import parser from '@/utils/rss-parser';
|
||||
import { config } from '@/config';
|
||||
import nock from 'nock';
|
||||
|
||||
describe('got', () => {
|
||||
it('headers', async () => {
|
||||
nock('http://rsshub.test')
|
||||
.get('/test')
|
||||
.reply(function () {
|
||||
expect(this.req.headers['user-agent']).toBe(config.ua);
|
||||
return [200, '<rss version="2.0"><channel><item></item></channel></rss>'];
|
||||
});
|
||||
|
||||
await parser.parseURL('http://rsshub.test/test');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user