增加post服务

This commit is contained in:
Jeremy Yin 2019-06-26 21:26:40 +08:00
parent 1f12ad7557
commit 8bbd894976
3 changed files with 25 additions and 1 deletions

View File

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

View File

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

View File

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