Created
August 12, 2024 02:00
-
-
Save paulodutra/04b00b1600c2857264cbd8308a7fab67 to your computer and use it in GitHub Desktop.
Controller default test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Test, TestingModule } from '@nestjs/testing'; | |
import { TaskController } from './task.controller'; | |
import { TaskService } from './task.service'; | |
import { ModulesModule } from '../modules.module'; | |
import { DatabaseModule } from '@/infrastructure/database/database.module'; | |
describe('TaskController', () => { | |
let controller: TaskController; | |
beforeEach(async () => { | |
const module: TestingModule = await Test.createTestingModule({ | |
imports: [ModulesModule, DatabaseModule.forRoot()], | |
controllers: [TaskController], | |
providers: [TaskService], | |
}).compile(); | |
controller = module.get<TaskController>(TaskController); | |
}); | |
it('should be defined', () => { | |
expect(controller).toBeDefined(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment