diff --git a/src/app.controller.spec.ts b/src/app.controller.spec.ts new file mode 100644 index 0000000..aec925a --- /dev/null +++ b/src/app.controller.spec.ts @@ -0,0 +1,18 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { AppController } from './app.controller'; + +describe('AppController', () => { + let controller: AppController; + + beforeEach(async () => { + const module: TestingModule = await Test.createTestingModule({ + controllers: [AppController], + }).compile(); + + controller = module.get(AppController); + }); + + it('should be defined', () => { + expect(controller).toBeDefined(); + }); +}); diff --git a/src/app.controller.ts b/src/app.controller.ts new file mode 100644 index 0000000..075c374 --- /dev/null +++ b/src/app.controller.ts @@ -0,0 +1,9 @@ +import { Controller, Get } from '@nestjs/common'; + +@Controller() +export class AppController { + @Get() + sayHi() { + return 'hi'; + } +} diff --git a/src/app.module.ts b/src/app.module.ts index b27d127..a93925a 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -2,6 +2,8 @@ import { Module } from '@nestjs/common'; import { ConfigModule, ConfigService } from '@nestjs/config'; import { validationSchema } from './config/validationSchema'; import { TypeOrmModule } from '@nestjs/typeorm'; +import { AppController } from './app.controller'; +import { AppService } from './app.service'; @Module({ imports: [ @@ -26,5 +28,7 @@ import { TypeOrmModule } from '@nestjs/typeorm'; }), }), ], + controllers: [AppController], + providers: [AppService], }) export class AppModule {} diff --git a/src/app.service.spec.ts b/src/app.service.spec.ts new file mode 100644 index 0000000..0d00252 --- /dev/null +++ b/src/app.service.spec.ts @@ -0,0 +1,18 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { AppService } from './app.service'; + +describe('AppService', () => { + let service: AppService; + + beforeEach(async () => { + const module: TestingModule = await Test.createTestingModule({ + providers: [AppService], + }).compile(); + + service = module.get(AppService); + }); + + it('should be defined', () => { + expect(service).toBeDefined(); + }); +}); diff --git a/src/app.service.ts b/src/app.service.ts new file mode 100644 index 0000000..7263d33 --- /dev/null +++ b/src/app.service.ts @@ -0,0 +1,4 @@ +import { Injectable } from '@nestjs/common'; + +@Injectable() +export class AppService {}