| 1 | import { Test, TestingModule } from '@nestjs/testing'; |
| 2 | import { AppController } from './app.controller'; |
| 3 | import { AppService } from './app.service'; |
| 4 | |
| 5 | describe('AppController', () => { |
| 6 | let appController: AppController; |
| 7 | |
| 8 | beforeEach(async () => { |
| 9 | const app: TestingModule = await Test.createTestingModule({ |
| 10 | controllers: [AppController], |
| 11 | providers: [AppService], |
| 12 | }).compile(); |
| 13 | |
| 14 | appController = app.get<AppController>(AppController); |
| 15 | }); |
| 16 | |
| 17 | describe('root', () => { |
| 18 | it('should return "Hello World!"', () => { |
| 19 | expect(appController.getHello()).toBe('Hello World!'); |
| 20 | }); |
| 21 | }); |
| 22 | }); |
| 23 |