Skip to content

Commit 9980cbf

Browse files
Merge pull request #194 from davolokh/console-error-in-test-removed
console.error pollution logs removed in tests
2 parents c8bcc21 + fee4bbe commit 9980cbf

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

src/client/sse.test.ts

+2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ describe("SSEClientTransport", () => {
5656
baseUrl = new URL(`http://127.0.0.1:${addr.port}`);
5757
done();
5858
});
59+
60+
jest.spyOn(console, 'error').mockImplementation(() => {});
5961
});
6062

6163
afterEach(async () => {

src/server/auth/middleware/bearerAuth.test.ts

+4
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ describe("requireBearerAuth middleware", () => {
3131
set: jest.fn().mockReturnThis(),
3232
};
3333
nextFunction = jest.fn();
34+
jest.spyOn(console, 'error').mockImplementation(() => {});
35+
})
36+
37+
afterEach(() => {
3438
jest.clearAllMocks();
3539
});
3640

src/server/auth/router.test.ts

+5
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,11 @@ describe('MCP Auth Router', () => {
259259
issuerUrl: new URL('https://auth.example.com')
260260
};
261261
app.use(mcpAuthRouter(options));
262+
jest.spyOn(console, 'error').mockImplementation(() => {});
263+
});
264+
265+
afterEach(() => {
266+
jest.restoreAllMocks();
262267
});
263268

264269
it('routes to authorization endpoint', async () => {

0 commit comments

Comments
 (0)