import { Test, TestingModule } from '@nestjs/testing'; import { AuthController } from './auth.controller'; import { AuthService } from './auth.service'; import { makeAdB2cServiceMock, makeDefaultAdB2cMockValue, } from './test/auth.service.mock'; import { ConfigModule } from '@nestjs/config'; describe('AuthController', () => { let controller: AuthController; beforeEach(async () => { const module: TestingModule = await Test.createTestingModule({ imports: [ ConfigModule.forRoot({ envFilePath: ['.env.local', '.env'], isGlobal: true, }), ], controllers: [AuthController], providers: [AuthService], }) .useMocker(() => makeAdB2cServiceMock(makeDefaultAdB2cMockValue())) .compile(); controller = module.get(AuthController); }); it('should be defined', () => { expect(controller).toBeDefined(); }); });