From 017e405c41fda4f7328eca78157b41359697a31e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 5 Nov 2025 11:15:19 +0000 Subject: [PATCH] Address code review comments: remove redundant cleanup and clarify test intent Co-authored-by: samanhappy <2755122+samanhappy@users.noreply.github.com> --- tests/integration/base-path-routes.test.ts | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/tests/integration/base-path-routes.test.ts b/tests/integration/base-path-routes.test.ts index 7b22c70..26ee6c0 100644 --- a/tests/integration/base-path-routes.test.ts +++ b/tests/integration/base-path-routes.test.ts @@ -77,9 +77,6 @@ describe('AppServer with BASE_PATH configuration', () => { // Test that /mcphub/public-config endpoint exists const publicConfigResponse = await request(app).get('/mcphub/public-config'); expect(publicConfigResponse.status).not.toBe(404); - - // Clean up - delete process.env.BASE_PATH; }); it('should serve auth routes without BASE_PATH (default)', async () => { @@ -109,7 +106,7 @@ describe('AppServer with BASE_PATH configuration', () => { expect(publicConfigResponse.status).not.toBe(404); }); - it('should correctly mount API routes with BASE_PATH', async () => { + it('should serve global endpoints without BASE_PATH prefix', async () => { process.env.BASE_PATH = '/test-base/'; jest.resetModules(); @@ -121,11 +118,13 @@ describe('AppServer with BASE_PATH configuration', () => { const app = appServer.getApp(); - // Test that API routes are accessible with base path - const apiHealthResponse = await request(app).get('/health'); - expect(apiHealthResponse.status).not.toBe(404); + // Test that /health endpoint is accessible globally (no BASE_PATH prefix) + // The /health endpoint is intentionally mounted without BASE_PATH + const healthResponse = await request(app).get('/health'); + expect(healthResponse.status).not.toBe(404); - // Clean up - delete process.env.BASE_PATH; + // Also verify that BASE_PATH prefixed routes exist + const configResponse = await request(app).get('/test-base/config'); + expect(configResponse.status).not.toBe(404); }); });