nest generate controller posts
This commit is contained in:
parent
40ff4c3fc2
commit
396ffae09e
|
@ -1,10 +1,11 @@
|
|||
import { Module } from '@nestjs/common';
|
||||
import { AppController } from './app.controller';
|
||||
import { AppService } from './app.service';
|
||||
import { PostsController } from './posts/posts.controller';
|
||||
|
||||
@Module({
|
||||
imports: [],
|
||||
controllers: [AppController],
|
||||
controllers: [AppController, PostsController],
|
||||
providers: [AppService],
|
||||
})
|
||||
export class AppModule {}
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { PostsController } from './posts.controller';
|
||||
|
||||
describe('Posts Controller', () => {
|
||||
let controller: PostsController;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
controllers: [PostsController],
|
||||
}).compile();
|
||||
|
||||
controller = module.get<PostsController>(PostsController);
|
||||
});
|
||||
|
||||
it('should be defined', () => {
|
||||
expect(controller).toBeDefined();
|
||||
});
|
||||
});
|
|
@ -0,0 +1,4 @@
|
|||
import { Controller } from '@nestjs/common';
|
||||
|
||||
@Controller('posts')
|
||||
export class PostsController {}
|
Loading…
Reference in New Issue