add tests
This commit is contained in:
30
apps/api/src/domain/hello/HelloModule.test.ts
Normal file
30
apps/api/src/domain/hello/HelloModule.test.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { HelloController } from './HelloController';
|
||||
import { HelloModule } from './HelloModule';
|
||||
import { HelloService } from './HelloService';
|
||||
|
||||
describe('HelloModule', () => {
|
||||
let module: TestingModule;
|
||||
|
||||
beforeEach(async () => {
|
||||
module = await Test.createTestingModule({
|
||||
imports: [HelloModule],
|
||||
}).compile();
|
||||
});
|
||||
|
||||
it('should compile the module', () => {
|
||||
expect(module).toBeDefined();
|
||||
});
|
||||
|
||||
it('should provide HelloController', () => {
|
||||
const controller = module.get<HelloController>(HelloController);
|
||||
expect(controller).toBeDefined();
|
||||
expect(controller).toBeInstanceOf(HelloController);
|
||||
});
|
||||
|
||||
it('should provide HelloService', () => {
|
||||
const service = module.get<HelloService>(HelloService);
|
||||
expect(service).toBeDefined();
|
||||
expect(service).toBeInstanceOf(HelloService);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user