25 lines
758 B
TypeScript
25 lines
758 B
TypeScript
import { Test, TestingModule } from '@nestjs/testing';
|
|
import { QuizController } from './quiz.controller';
|
|
import {QuizService} from "./quiz.service";
|
|
import {QuizServiceMock} from "../mocks/quiz-service.mock";
|
|
|
|
describe('QuizController', () => {
|
|
let controller: QuizController;
|
|
let quizService: QuizService;
|
|
|
|
beforeEach(async () => {
|
|
const module: TestingModule = await Test.createTestingModule({
|
|
controllers: [QuizController],
|
|
providers: [
|
|
{ provide: QuizService, useValue: QuizServiceMock },
|
|
]
|
|
}).compile();
|
|
|
|
controller = module.get<QuizController>(QuizController);
|
|
quizService = module.get<QuizService>(QuizService);
|
|
});
|
|
|
|
it('should be defined', () => {
|
|
expect(controller).toBeDefined();
|
|
});
|
|
});
|