diff --git a/lib/setup.test.ts b/lib/setup.test.ts index 2946cdd13..4e39c68df 100644 --- a/lib/setup.test.ts +++ b/lib/setup.test.ts @@ -66,7 +66,8 @@ const server = setupServer( return HttpResponse.json({ test: jsonData?.test, }); - }) + }), + http.get(`http://rsshub.test/rss`, () => HttpResponse.text('')) ); server.listen(); diff --git a/lib/utils/rss-parser.test.ts b/lib/utils/rss-parser.test.ts index 20b6664b5..0b09b61ea 100644 --- a/lib/utils/rss-parser.test.ts +++ b/lib/utils/rss-parser.test.ts @@ -1,17 +1,9 @@ import { describe, expect, it } from 'vitest'; 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, '']; - }); - - await parser.parseURL('http://rsshub.test/test'); +describe('rss-parser', () => { + it('rss', async () => { + const result = await parser.parseURL('http://rsshub.test/rss'); + expect(result).toBeTruthy(); }); });