Skip to content

Commit

Permalink
feat: comments root 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
yummyicecream committed Jan 28, 2024
1 parent f83e28c commit 9324009
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/app.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ export class AppController {
return this.appService.getHello();
}
}


3 changes: 2 additions & 1 deletion src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import { AppController } from './app.controller';
import { AppService } from './app.service';
import { PostsModule } from './posts/posts.module';
import { UserModule } from './user/user.module';
import { CommentsModule } from './comments/comments.module';

@Module({
imports: [PostsModule, UserModule],
imports: [PostsModule, UserModule, CommentsModule],
controllers: [AppController],
providers: [AppService],
})
Expand Down
18 changes: 18 additions & 0 deletions src/comments/comments.controller.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Test, TestingModule } from '@nestjs/testing';
import { CommentsController } from './comments.controller';

describe('CommentsController', () => {
let controller: CommentsController;

beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
controllers: [CommentsController],
}).compile();

controller = module.get<CommentsController>(CommentsController);
});

it('should be defined', () => {
expect(controller).toBeDefined();
});
});
4 changes: 4 additions & 0 deletions src/comments/comments.controller.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { Controller } from '@nestjs/common';

@Controller('comments')
export class CommentsController {}
9 changes: 9 additions & 0 deletions src/comments/comments.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Module } from '@nestjs/common';
import { CommentsController } from './comments.controller';
import { CommentsService } from './comments.service';

@Module({
controllers: [CommentsController],
providers: [CommentsService]
})
export class CommentsModule {}
18 changes: 18 additions & 0 deletions src/comments/comments.service.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Test, TestingModule } from '@nestjs/testing';
import { CommentsService } from './comments.service';

describe('CommentsService', () => {
let service: CommentsService;

beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [CommentsService],
}).compile();

service = module.get<CommentsService>(CommentsService);
});

it('should be defined', () => {
expect(service).toBeDefined();
});
});
4 changes: 4 additions & 0 deletions src/comments/comments.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { Injectable } from '@nestjs/common';

@Injectable()
export class CommentsService {}

0 comments on commit 9324009

Please sign in to comment.