Spaces:
Sleeping

File size: 695 Bytes
60606a1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e00a29f
 
 
60606a1
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { Test, TestingModule } from '@nestjs/testing';
import { AppController } from './app.controller';
import { AppService } from './app.service';

describe('AppController', () => {
  let appController: AppController;

  beforeEach(async () => {
    const app: TestingModule = await Test.createTestingModule({
      controllers: [AppController],
      providers: [AppService],
    }).compile();

    appController = app.get<AppController>(AppController);
  });

  describe('root', () => {
    it('should return "Hello World!"', () => {
      const versionSpy = jest.spyOn(appController, 'version');
      appController.version();
      expect(versionSpy).toHaveBeenCalled();
    });
  });
});