장재혁

Add Structure for api

......@@ -6,6 +6,10 @@ import { AppController } from './app.controller';
import { AppService } from './app.service';
import { MypageModule } from './mypage/mypage.module';
import { PostModule } from './post/post.module';
import { CommentModule } from './comment/comment.module';
import { UserModule } from './user/user.module';
import { LikeableService } from './likeable/likeable.service';
import { LikeableModule } from './likeable/likeable.module';
@Module({
imports: [
......@@ -22,8 +26,11 @@ import { PostModule } from './post/post.module';
}),
MypageModule,
PostModule,
CommentModule,
UserModule,
LikeableModule,
],
controllers: [AppController],
providers: [AppService],
providers: [AppService, LikeableService],
})
export class AppModule {}
......
import { Module } from '@nestjs/common';
import { CommentService } from './comment.service';
import { CommentResolver } from './comment.resolver';
@Module({
providers: [CommentService, CommentResolver],
})
export class CommentModule {}
import { Test, TestingModule } from '@nestjs/testing';
import { CommentResolver } from './comment.resolver';
describe('CommentResolver', () => {
let resolver: CommentResolver;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [CommentResolver],
}).compile();
resolver = module.get<CommentResolver>(CommentResolver);
});
it('should be defined', () => {
expect(resolver).toBeDefined();
});
});
import { Resolver } from '@nestjs/graphql';
@Resolver()
export class CommentResolver {}
import { Test, TestingModule } from '@nestjs/testing';
import { CommentService } from './comment.service';
describe('CommentService', () => {
let service: CommentService;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [CommentService],
}).compile();
service = module.get<CommentService>(CommentService);
});
it('should be defined', () => {
expect(service).toBeDefined();
});
});
import { Injectable } from '@nestjs/common';
@Injectable()
export class CommentService {}
import { Module } from '@nestjs/common';
import { LikeableResolver } from './likeable.resolver';
@Module({
providers: [LikeableResolver],
})
export class LikeableModule {}
import { Test, TestingModule } from '@nestjs/testing';
import { LikeableResolver } from './likeable.resolver';
describe('LikeableResolver', () => {
let resolver: LikeableResolver;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [LikeableResolver],
}).compile();
resolver = module.get<LikeableResolver>(LikeableResolver);
});
it('should be defined', () => {
expect(resolver).toBeDefined();
});
});
import { Resolver } from '@nestjs/graphql';
@Resolver()
export class LikeableResolver {}
import { Test, TestingModule } from '@nestjs/testing';
import { LikeableService } from './likeable.service';
describe('LikeableService', () => {
let service: LikeableService;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [LikeableService],
}).compile();
service = module.get<LikeableService>(LikeableService);
});
it('should be defined', () => {
expect(service).toBeDefined();
});
});
import { Injectable } from '@nestjs/common';
@Injectable()
export class LikeableService {}
import { Module } from '@nestjs/common';
import { UserResolver } from './user.resolver';
import { UserService } from './user.service';
@Module({
providers: [UserResolver, UserService]
})
export class UserModule {}
import { Test, TestingModule } from '@nestjs/testing';
import { UserResolver } from './user.resolver';
describe('UserResolver', () => {
let resolver: UserResolver;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [UserResolver],
}).compile();
resolver = module.get<UserResolver>(UserResolver);
});
it('should be defined', () => {
expect(resolver).toBeDefined();
});
});
import { Resolver } from '@nestjs/graphql';
@Resolver()
export class UserResolver {}
import { Test, TestingModule } from '@nestjs/testing';
import { UserService } from './user.service';
describe('UserService', () => {
let service: UserService;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [UserService],
}).compile();
service = module.get<UserService>(UserService);
});
it('should be defined', () => {
expect(service).toBeDefined();
});
});
import { Injectable } from '@nestjs/common';
@Injectable()
export class UserService {}