From 2f5989be4983c34ce63ee605fccf5d6248703eb1 Mon Sep 17 00:00:00 2001 From: wangdl Date: Sun, 21 Jun 2026 11:37:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Gate=20E2E=20=E2=80=94=20Test.createTest?= =?UTF-8?q?ingModule=20=E7=BC=BA=E5=B0=91=20Reflector=20provider?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AdminAuthGuard 依赖 Reflector(@nestjs/core),TestingModule 不会自动导入。 Co-Authored-By: Claude --- test/m-ai-03-gate.e2e-spec.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/m-ai-03-gate.e2e-spec.ts b/test/m-ai-03-gate.e2e-spec.ts index 20a8893..66dc293 100644 --- a/test/m-ai-03-gate.e2e-spec.ts +++ b/test/m-ai-03-gate.e2e-spec.ts @@ -1,5 +1,6 @@ import { Test, TestingModule } from '@nestjs/testing'; import { INestApplication } from '@nestjs/common'; +import { Reflector } from '@nestjs/core'; import { JwtService } from '@nestjs/jwt'; import request from 'supertest'; import { AppModule } from '../src/app.module'; @@ -43,6 +44,7 @@ describe('M-AI-03 GATE E2E (fail-closed)', () => { // AppModule.init() 连接 Prisma + Redis — 失败则测试 fail-closed const module: TestingModule = await Test.createTestingModule({ imports: [AppModule], + providers: [Reflector], }).compile(); app = module.createNestApplication();