新建post控制器

This commit is contained in:
Jeremy Yin 2019-06-26 21:24:50 +08:00
parent 770c7dbd79
commit 1f12ad7557
3 changed files with 26 additions and 1 deletions

View File

@ -0,0 +1,18 @@
import { Test, TestingModule } from '@nestjs/testing';
import { PostController } from './post.controller';
describe('Post Controller', () => {
let controller: PostController;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
controllers: [PostController],
}).compile();
controller = module.get<PostController>(PostController);
});
it('should be defined', () => {
expect(controller).toBeDefined();
});
});

View File

@ -0,0 +1,4 @@
import { Controller } from '@nestjs/common';
@Controller('post')
export class PostController {}

View File

@ -1,4 +1,7 @@
import { Module } from '@nestjs/common';
import { PostController } from './post.controller';
@Module({})
@Module({
controllers: [PostController]
})
export class PostModule {}