From c674df72a2d577287ebc5d6b7595c5f05071c261 Mon Sep 17 00:00:00 2001 From: Maurice Date: Sun, 9 Aug 2026 22:42:55 +0200 Subject: [PATCH] Keep the atlas controller test free of the MCP SDK chain Asserting the module registration meant importing AtlasModule, which pulls AtlasMcp and the whole MCP SDK behind it into a file that otherwise constructs a controller with a stub. It does not resolve when the file runs on its own. PROFILE-014 already covers the registration, and covers it better: it calls GET /api/auth/travel-stats through the full app. --- server/tests/unit/nest/atlas.controller.test.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/server/tests/unit/nest/atlas.controller.test.ts b/server/tests/unit/nest/atlas.controller.test.ts index 20aa3652f..0f2243e5a 100644 --- a/server/tests/unit/nest/atlas.controller.test.ts +++ b/server/tests/unit/nest/atlas.controller.test.ts @@ -4,8 +4,6 @@ import type { Response } from 'express'; import { AtlasController } from '../../../src/nest/atlas/atlas.controller'; import { TravelStatsController } from '../../../src/nest/atlas/travel-stats.controller'; import { JwtAuthGuard } from '../../../src/nest/auth/jwt-auth.guard'; -import { AtlasModule } from '../../../src/nest/atlas/atlas.module'; -import { expectRegisteredController } from '../../helpers/module-providers'; import type { AtlasService } from '../../../src/nest/atlas/atlas.service'; import type { User } from '../../../src/types'; @@ -185,6 +183,10 @@ describe('TravelStatsController', () => { expect(Reflect.getMetadata('method', TravelStatsController.prototype.travelStats)).toBe(RequestMethod.GET); }); + // No module-registration check here: importing AtlasModule drags AtlasMcp and + // the whole MCP SDK chain into what is otherwise a plain controller test, and + // it fails to resolve when the file runs on its own. PROFILE-014 covers the + // registration better anyway — it calls the route through the full app. it('ATLAS-TRAVEL-004: keeps the JwtAuthGuard the route had on AuthController', () => { // Array shape asserted first on purpose: expect(undefined).toContain(SomeClass) // passes in this vitest version, so the plain form would stop guarding the @@ -194,7 +196,4 @@ describe('TravelStatsController', () => { expect(guards).toEqual(expect.arrayContaining([JwtAuthGuard])); }); - it('ATLAS-TRAVEL-005: AtlasModule registers the controller, so the route actually exists', () => { - expectRegisteredController(AtlasModule, TravelStatsController); - }); });