import { Test , TestingModule } from '@nestjs/testing' ; import { HelloController } from './hello.controller' ; import { HelloService } from './hello.service' ; describe ( 'AppController' , ( ) => { let appController ; beforeEach ( async ( ) => { const app = await Test . createTestingModule ( { controllers : [ HelloController ] , providers : [ HelloService ] , } ) . compile ( ) ; appController = app . get < HelloController > ( HelloController ) ; } ) ; describe ( 'root' , ( ) => { it ( 'should return "Hello World!"' , ( ) => { expect ( appController . getHello ( ) ) . toBe ( 'Hello World!' ) ; } ) ; } ) ; } ) ;