console.error pollution removed in tests

This commit is contained in:
Dmitry Volokh 2025-03-14 19:54:03 +01:00
commit fee4bbec58
3 changed files with 11 additions and 0 deletions

View file

@ -56,6 +56,8 @@ describe("SSEClientTransport", () => {
baseUrl = new URL(`http://127.0.0.1:${addr.port}`);
done();
});
jest.spyOn(console, 'error').mockImplementation(() => {});
});
afterEach(async () => {

View file

@ -31,6 +31,10 @@ describe("requireBearerAuth middleware", () => {
set: jest.fn().mockReturnThis(),
};
nextFunction = jest.fn();
jest.spyOn(console, 'error').mockImplementation(() => {});
})
afterEach(() => {
jest.clearAllMocks();
});

View file

@ -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 () => {