Skip to content

Commit a8b0b82

Browse files
committed
test: update config mocking in route and plugin tests
1 parent 0c8477b commit a8b0b82

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

tests/plugins/print-registered-routes.test.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@ import { config, env } from '../../src/config';
44
import printRegisteredRoutes from '../../src/plugins/print-registered-routes';
55
import { buildFastifyInstance } from '../__helpers__/fastify';
66

7-
jest.mock('../../src/config');
7+
jest.mock('../../src/config', () => ({
8+
config: {
9+
tld: undefined,
10+
},
11+
env: {
12+
PORT: undefined,
13+
},
14+
}));
815

916
describe('Print Registered Routes Plugin', () => {
1017
const fastify: FastifyInstance = buildFastifyInstance([

tests/routes/pac-route.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ import { getProxyUri } from '../../src/utils/get-proxy-uri';
1010
import { StatusCodes } from '../../src/utils/http';
1111
import { buildFastifyInstance } from '../__helpers__/fastify';
1212

13-
jest.mock('../../src/config');
13+
jest.mock('../../src/config', () => ({
14+
config: {
15+
tld: undefined,
16+
},
17+
}));
1418
jest.mock('../../src/utils/get-proxy-uri');
1519

1620
const host: string = '127.0.0.1:3000';

0 commit comments

Comments
 (0)