diff --git a/src/client/sse.test.ts b/src/client/sse.test.ts index 2b166530..b77938ca 100644 --- a/src/client/sse.test.ts +++ b/src/client/sse.test.ts @@ -56,6 +56,8 @@ describe("SSEClientTransport", () => { baseUrl = new URL(`http://127.0.0.1:${addr.port}`); done(); }); + + jest.spyOn(console, 'error').mockImplementation(() => {}); }); afterEach(async () => { diff --git a/src/server/auth/middleware/bearerAuth.test.ts b/src/server/auth/middleware/bearerAuth.test.ts index da2f5838..43cbfa0a 100644 --- a/src/server/auth/middleware/bearerAuth.test.ts +++ b/src/server/auth/middleware/bearerAuth.test.ts @@ -31,6 +31,10 @@ describe("requireBearerAuth middleware", () => { set: jest.fn().mockReturnThis(), }; nextFunction = jest.fn(); + jest.spyOn(console, 'error').mockImplementation(() => {}); + }) + + afterEach(() => { jest.clearAllMocks(); }); diff --git a/src/server/auth/router.test.ts b/src/server/auth/router.test.ts index 38817cc1..86eda221 100644 --- a/src/server/auth/router.test.ts +++ b/src/server/auth/router.test.ts @@ -259,6 +259,11 @@ describe('MCP Auth Router', () => { issuerUrl: new URL('https://auth.example.com') }; app.use(mcpAuthRouter(options)); + jest.spyOn(console, 'error').mockImplementation(() => {}); + }); + + afterEach(() => { + jest.restoreAllMocks(); }); it('routes to authorization endpoint', async () => {