github-actions-nestjs-app / src / app.controller.spec.ts
app.controller.spec.ts
Raw
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 From Agnes"', () => {
      expect(appController.getHello()).toBe('Hello From Agnes');
    });
  });
});