新建post控制器
This commit is contained in:
parent
770c7dbd79
commit
1f12ad7557
|
@ -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();
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,4 @@
|
||||||
|
import { Controller } from '@nestjs/common';
|
||||||
|
|
||||||
|
@Controller('post')
|
||||||
|
export class PostController {}
|
|
@ -1,4 +1,7 @@
|
||||||
import { Module } from '@nestjs/common';
|
import { Module } from '@nestjs/common';
|
||||||
|
import { PostController } from './post.controller';
|
||||||
|
|
||||||
@Module({})
|
@Module({
|
||||||
|
controllers: [PostController]
|
||||||
|
})
|
||||||
export class PostModule {}
|
export class PostModule {}
|
||||||
|
|
Loading…
Reference in New Issue