Skip to content

Commit

Permalink
fix: test
Browse files Browse the repository at this point in the history
  • Loading branch information
ttttmr committed Sep 24, 2024
1 parent cf5f968 commit 792fd52
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/middleware/parameter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Parser from 'rss-parser';

process.env.OPENAI_API_KEY = 'sk-1234567890';
process.env.OPENAI_API_ENDPOINT = 'https://api.openai.mock/v1';
process.env.ALLOW_CIDR = '127.0.0.1/32';

vi.mock('@/utils/request-rewriter', () => ({ default: null }));
const { config } = await import('@/config');
Expand Down
2 changes: 2 additions & 0 deletions lib/utils/got.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import got from '@/utils/got';
import { config } from '@/config';
import { Cookie, CookieJar } from 'tough-cookie';

process.env.ALLOW_CIDR = '127.0.0.1/32';

describe('got', () => {
it('headers', async () => {
const { data } = await got('http://rsshub.test/headers');
Expand Down
2 changes: 2 additions & 0 deletions lib/utils/ofetch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { http, HttpResponse } from 'msw';
import ofetch from '@/utils/ofetch';
import { config } from '@/config';

process.env.ALLOW_CIDR = '127.0.0.1/32';

describe('ofetch', () => {
it('headers', async () => {
const data = await ofetch('http://rsshub.test/headers');
Expand Down
1 change: 1 addition & 0 deletions lib/utils/request-rewriter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import http from 'node:http';
process.env.PROXY_URI = 'http://rsshub.proxy:2333/';
process.env.PROXY_AUTH = 'rsshubtest';
process.env.PROXY_URL_REGEX = 'headers';
process.env.ALLOW_CIDR = '127.0.0.1/32';

await import('@/utils/request-rewriter');
const { config } = await import('@/config');
Expand Down

0 comments on commit 792fd52

Please sign in to comment.