Skip to content

Commit

Permalink
Mock 데이터를 가진 fixture 폴더를 옮겨라
Browse files Browse the repository at this point in the history
src 폴더는 서비스를 운영하고 있음으로 폴더를 외부로 옮겼습니다
  • Loading branch information
jihwooon committed Nov 3, 2023
1 parent 9011947 commit be26a9d
Show file tree
Hide file tree
Showing 38 changed files with 65 additions and 65 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { userMock } from './memberFixture'
import { Delivery } from '../delivery/domain/delivery.entity'
import { Delivery } from '../src/delivery/domain/delivery.entity'

export const deliveryMock = (): Delivery => {
return {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ItemStatusEnum } from '../items/domain/item-status.enum'
import { Item } from '../items/domain/item.entity'
import { ItemStatusEnum } from '../src/items/domain/item-status.enum'
import { Item } from '../src/items/domain/item.entity'
import { userMock } from './memberFixture'

export const itemMock = (): Item => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ItemImage } from '../item-images/domain/item-image.entity'
import { ItemImage } from '../src/item-images/domain/item-image.entity'
import { itemMock } from './itemFixture'

export const itemImageMock = (): ItemImage => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TokenType } from '../jwt/token-type.enum'
import { TokenType } from '../src/jwt/token-type.enum'

export const jwtTokenFixture = () => {
return {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Role } from '../members/domain/member-role.enum'
import { MemberType } from '../members/domain/member-type.enum'
import { Member } from '../members/domain/member.entity'
import { Role } from '../src/members/domain/member-role.enum'
import { MemberType } from '../src/members/domain/member-type.enum'
import { Member } from '../src/members/domain/member.entity'

export const userMock = (): Member => {
return {
Expand Down
4 changes: 2 additions & 2 deletions server/src/auth/signin/application/signin.service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { InternalServerErrorException, BadRequestException } from '@nestjs/commo
import { PasswordProvider } from '../../../members/application/password.provider'
import { TokenIssuer } from '../../token/application/token.issuer'
import { MemberNotFoundException } from '../../../members/application/error/member-not-found.exception'
import { userMock } from '../../../fixture/memberFixture'
import { jwtTokenFixture } from '../../../fixture/jwtTokenFixture'
import { userMock } from '../../../../fixture/memberFixture'
import { jwtTokenFixture } from '../../../../fixture/jwtTokenFixture'

describe('Signup class', () => {
let connect: Connection
Expand Down
4 changes: 2 additions & 2 deletions server/src/auth/signin/web/signin.controller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { SigninService } from '../application/signin.service'
import { SigninController } from './signin.controller'
import { TokenIssuer } from '../../token/application/token.issuer'
import { MemberNotFoundException } from '../../../members/application/error/member-not-found.exception'
import { jwtTokenFixture } from '../../../fixture/jwtTokenFixture'
import { userMock } from '../../../fixture/memberFixture'
import { jwtTokenFixture } from '../../../../fixture/jwtTokenFixture'
import { userMock } from '../../../../fixture/memberFixture'
import { LoginMemberDto } from '../../../members/dto/login-member.dto'
import { SigninResponseDto } from '../dto/signin-response.dto'

Expand Down
4 changes: 2 additions & 2 deletions server/src/auth/signout/application/signout.service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import { MemberNotFoundException } from '../../../members/application/error/memb
import { NotAccessTokenTypeException } from '../../token/error/not-access-token-type.exception'
import { InternalServerErrorException } from '@nestjs/common'
import { TokenIssuer } from '../../token/application/token.issuer'
import { userMock } from '../../../fixture/memberFixture'
import { jwtTokenFixture } from '../../../fixture/jwtTokenFixture'
import { userMock } from '../../../../fixture/memberFixture'
import { jwtTokenFixture } from '../../../../fixture/jwtTokenFixture'

describe('Signout class', () => {
let connect: Connection
Expand Down
2 changes: 1 addition & 1 deletion server/src/auth/signout/web/signout.controller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { JwtProvider } from '../../../jwt/jwt.provider'
import { Response } from 'express'
import { TokenIssuer } from '../../token/application/token.issuer'
import { MemberNotFoundException } from '../../../members/application/error/member-not-found.exception'
import { jwtTokenFixture } from '../../../fixture/jwtTokenFixture'
import { jwtTokenFixture } from '../../../../fixture/jwtTokenFixture'

describe('SignoutController class', () => {
let signoutController: SignoutController
Expand Down
2 changes: 1 addition & 1 deletion server/src/auth/signup/application/signup.service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { MYSQL_CONNECTION } from '../../../database/constants'
import { SignupService } from './signup.service'
import { PasswordProvider } from '../../../members/application/password.provider'
import { JwtProvider } from '../../../jwt/jwt.provider'
import { userMock } from '../../../fixture/memberFixture'
import { userMock } from '../../../../fixture/memberFixture'

describe('Signup class', () => {
let connect: Connection
Expand Down
2 changes: 1 addition & 1 deletion server/src/auth/signup/web/signup.controller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Connection } from 'mysql2/promise'
import { MemberRepository } from '../../../members/domain/member.repository'
import { EmailChecker } from '../../../members/application/email.checker'
import { MYSQL_CONNECTION } from '../../../database/constants'
import { userMock } from '../../../fixture/memberFixture'
import { userMock } from '../../../../fixture/memberFixture'
import { SignupService } from '../application/signup.service'
import { PasswordProvider } from '../../../members/application/password.provider'
import { JwtProvider } from '../../../jwt/jwt.provider'
Expand Down
4 changes: 2 additions & 2 deletions server/src/auth/token/application/token.issuer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { TokenIssuer } from './token.issuer'
import { MemberRepository } from '../../../members/domain/member.repository'
import { MYSQL_CONNECTION } from '../../../database/constants'
import { MemberNotFoundException } from '../../../members/application/error/member-not-found.exception'
import { userMock } from '../../../fixture/memberFixture'
import { userMock } from '../../../../fixture/memberFixture'
import { JwtProvider } from '../../../jwt/jwt.provider'
import { TokenExpiredException } from '../error/token_expired.exception'
import { InternalServerErrorException } from '@nestjs/common'
import { jwtTokenFixture } from '../../../fixture/jwtTokenFixture'
import { jwtTokenFixture } from '../../../../fixture/jwtTokenFixture'

describe('TokenIssuer class', () => {
let connect: Connection
Expand Down
2 changes: 1 addition & 1 deletion server/src/auth/token/web/token.controller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { MYSQL_CONNECTION } from '../../../database/constants'
import { JwtProvider } from '../../../jwt/jwt.provider'
import { TokenController } from './token.controller'
import { TokenIssuer } from '../application/token.issuer'
import { jwtTokenFixture } from '../../../fixture/jwtTokenFixture'
import { jwtTokenFixture } from '../../../../fixture/jwtTokenFixture'
import { TokenExpiredException } from '../error/token_expired.exception'
import { MemberNotFoundException } from '../../../members/application/error/member-not-found.exception'

Expand Down
4 changes: 2 additions & 2 deletions server/src/delivery/domain/delivery.repository.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { RowDataPacket } from 'mysql2/promise'
import { MYSQL_CONNECTION } from '../../database/constants'
import { DeliveryRepository } from './delivery.repository'
import { userMock } from '../../fixture/memberFixture'
import { dbDeliveriesMock } from '../../fixture/deliveryFixture'
import { userMock } from '../../../fixture/memberFixture'
import { dbDeliveriesMock } from '../../../fixture/deliveryFixture'
import { Test, TestingModule } from '@nestjs/testing'

describe('DeliveryRepository class', () => {
Expand Down
4 changes: 2 additions & 2 deletions server/src/delivery/domain/delivery.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { userMock } from '../../fixture/memberFixture'
import { userMock } from '../../../fixture/memberFixture'
import { Delivery } from './delivery.entity'
import { deliveryMock } from '../../fixture/deliveryFixture'
import { deliveryMock } from '../../../fixture/deliveryFixture'

describe('Delivery', () => {
let delivery: Delivery
Expand Down
4 changes: 2 additions & 2 deletions server/src/item-images/application/item-image.creater.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Test, TestingModule } from '@nestjs/testing'
import { itemMock } from '../../fixture/itemFixture'
import { itemMock } from '../../../fixture/itemFixture'
import { MYSQL_CONNECTION } from '../../database/constants'
import { Connection } from 'mysql2/promise'
import { fileMock, filesMock, itemImageMock } from '../../fixture/itemImageFixture'
import { fileMock, filesMock, itemImageMock } from '../../../fixture/itemImageFixture'
import { ItemImageCreater } from './item-image.creater'
import { ItemImageRepository } from '../../item-images/domain/item-image.repository'
import { ItemRepository } from '../../items/domain/item.repository'
Expand Down
4 changes: 2 additions & 2 deletions server/src/item-images/application/item-image.updater.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Test, TestingModule } from '@nestjs/testing'
import { MYSQL_CONNECTION } from '../../database/constants'
import { Connection } from 'mysql2/promise'
import { fileMock, filesMock, itemImageMock } from '../../fixture/itemImageFixture'
import { fileMock, filesMock, itemImageMock } from '../../../fixture/itemImageFixture'
import { ItemImageRepository } from '../../item-images/domain/item-image.repository'
import { ItemImageUpdater } from './item-image.updater'
import { itemMock } from '../../fixture/itemFixture'
import { itemMock } from '../../../fixture/itemFixture'

describe('ItemImageUpdater class', () => {
let itemImageUpdater: ItemImageUpdater
Expand Down
4 changes: 2 additions & 2 deletions server/src/item-images/domain/item-image.repository.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { ResultSetHeader, RowDataPacket } from 'mysql2/promise'
import { Test, TestingModule } from '@nestjs/testing'
import { MYSQL_CONNECTION } from '../../database/constants'
import { ItemImageRepository } from './item-image.repository'
import { dbItemImagesMock, itemImageMock } from '../../fixture/itemImageFixture'
import { itemMock } from '../../fixture/itemFixture'
import { dbItemImagesMock, itemImageMock } from '../../../fixture/itemImageFixture'
import { itemMock } from '../../../fixture/itemFixture'

describe('ItemImageRepository class', () => {
let itemImageRepository: ItemImageRepository
Expand Down
2 changes: 1 addition & 1 deletion server/src/item-images/domain/item-image.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ItemImage } from './item-image.entity'
import { itemImageMock } from '../../fixture/itemImageFixture'
import { itemImageMock } from '../../../fixture/itemImageFixture'

describe('ItemImage', () => {
let itemImage: ItemImage
Expand Down
6 changes: 3 additions & 3 deletions server/src/items/application/item.creater.test.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { ItemRepository } from '../domain/item.repository'
import { Test, TestingModule } from '@nestjs/testing'
import { ItemCreater } from './item.creater'
import { itemMock } from '../../fixture/itemFixture'
import { itemMock } from '../../../fixture/itemFixture'
import { MYSQL_CONNECTION } from '../../database/constants'
import { Connection } from 'mysql2/promise'
import { InternalServerErrorException } from '@nestjs/common'
import { userMock } from '../../fixture/memberFixture'
import { userMock } from '../../../fixture/memberFixture'
import { MemberRepository } from '../../members/domain/member.repository'
import { MemberNotFoundException } from '../../members/application/error/member-not-found.exception'
import { when } from 'jest-when'
import { filesMock } from '../../fixture/itemImageFixture'
import { filesMock } from '../../../fixture/itemImageFixture'
import { ItemImageCreater } from '../../item-images/application/item-image.creater'
import { ItemImageRepository } from '../../item-images/domain/item-image.repository'

Expand Down
2 changes: 1 addition & 1 deletion server/src/items/application/item.reader.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ItemRepository } from '../domain/item.repository'
import { Test, TestingModule } from '@nestjs/testing'
import { itemMock } from '../../fixture/itemFixture'
import { itemMock } from '../../../fixture/itemFixture'
import { ItemReader } from './item.reader'
import { MYSQL_CONNECTION } from '../../database/constants'
import { Connection } from 'mysql2/promise'
Expand Down
6 changes: 3 additions & 3 deletions server/src/items/application/item.updater.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ import { Connection } from 'mysql2/promise'
import { Test, TestingModule } from '@nestjs/testing'
import { ItemUpdater } from './item.updater'
import { ItemRepository } from '../domain/item.repository'
import { itemMock } from '../../fixture/itemFixture'
import { itemMock } from '../../../fixture/itemFixture'
import { MYSQL_CONNECTION } from '../../database/constants'
import { when } from 'jest-when'
import { Item } from '../domain/item.entity'
import { ItemStatusEnum } from '../domain/item-status.enum'
import { userMock } from '../../fixture/memberFixture'
import { userMock } from '../../../fixture/memberFixture'
import { ItemNotFoundException } from '../error/item-not-found.exception'
import { ItemUpdatedFailException } from '../error/item-updated-fail.exception'
import { MemberRepository } from '../../members/domain/member.repository'
import { filesMock, itemImagesMock, itemImageMock } from '../../fixture/itemImageFixture'
import { filesMock, itemImagesMock, itemImageMock } from '../../../fixture/itemImageFixture'
import { ItemImageUpdater } from '../../item-images/application/item-image.updater'
import { ItemImageRepository } from '../../item-images/domain/item-image.repository'

Expand Down
2 changes: 1 addition & 1 deletion server/src/items/domain/item.repository.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ResultSetHeader, RowDataPacket } from 'mysql2/promise'
import { Test, TestingModule } from '@nestjs/testing'
import { dbItemMock, detailItemMock, itemMock } from '../../fixture/itemFixture'
import { dbItemMock, detailItemMock, itemMock } from '../../../fixture/itemFixture'
import { ItemRepository } from './item.repository'
import { MYSQL_CONNECTION } from '../../database/constants'

Expand Down
2 changes: 1 addition & 1 deletion server/src/items/domain/item.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Item } from './item.entity'
import { itemMock } from '../../fixture/itemFixture'
import { itemMock } from '../../../fixture/itemFixture'

describe('Item', () => {
let items: Item
Expand Down
4 changes: 2 additions & 2 deletions server/src/items/web/item-create.controller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import { Test, TestingModule } from '@nestjs/testing'
import { ItemCreateController } from './item-create.controller'
import { ItemCreater } from '../application/item.creater'
import { ItemRepository } from '../domain/item.repository'
import { itemMock } from '../../fixture/itemFixture'
import { itemMock } from '../../../fixture/itemFixture'
import { MYSQL_CONNECTION } from '../../database/constants'
import { Connection } from 'mysql2/promise'
import { CreateItemRequest } from '../dto/save-item.dto'
import { InternalServerErrorException } from '@nestjs/common'
import { JwtProvider } from '../../jwt/jwt.provider'
import { when } from 'jest-when'
import { userMock } from '../../fixture/memberFixture'
import { userMock } from '../../../fixture/memberFixture'

describe('ItemController class', () => {
let itemController: ItemCreateController
Expand Down
2 changes: 1 addition & 1 deletion server/src/items/web/item-detail.controller.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Test, TestingModule } from '@nestjs/testing'
import { ItemRepository } from '../domain/item.repository'
import { itemMock } from '../../fixture/itemFixture'
import { itemMock } from '../../../fixture/itemFixture'
import { ItemDetailController } from './item-detail.controller'
import { ItemReader } from '../application/item.reader'
import { MYSQL_CONNECTION } from '../../database/constants'
Expand Down
6 changes: 3 additions & 3 deletions server/src/items/web/item-update.controller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { ItemUpdater } from '../application/item.updater'
import { ItemRepository } from '../domain/item.repository'
import { MYSQL_CONNECTION } from '../../database/constants'
import { Connection } from 'mysql2/promise'
import { itemMock } from '../../fixture/itemFixture'
import { itemMock } from '../../../fixture/itemFixture'
import { UpdateItemRequest } from '../dto/update-item.dto'
import { JwtProvider } from '../../jwt/jwt.provider'
import { when } from 'jest-when'
import { userMock } from '../../fixture/memberFixture'
import { filesMock } from '../../fixture/itemImageFixture'
import { userMock } from '../../../fixture/memberFixture'
import { filesMock } from '../../../fixture/itemImageFixture'

describe('ItemUpdateController class', () => {
let itemController: ItemUpdateController
Expand Down
4 changes: 2 additions & 2 deletions server/src/jwt/jwt.provider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { Test, TestingModule } from '@nestjs/testing'
import { JwtProvider } from './jwt.provider'
import { BadRequestException, UnauthorizedException } from '@nestjs/common'
import { TokenType } from './token-type.enum'
import { userMock } from '../fixture/memberFixture'
import { jwtTokenFixture } from '../fixture/jwtTokenFixture'
import { userMock } from '../../fixture/memberFixture'
import { jwtTokenFixture } from '../../fixture/jwtTokenFixture'

describe('JwtProvider class', () => {
let jwtProvider: JwtProvider
Expand Down
2 changes: 1 addition & 1 deletion server/src/members/application/password.provider.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Test, TestingModule } from '@nestjs/testing'
import { PasswordProvider } from './password.provider'
import { BadRequestException } from '@nestjs/common'
import { userMock } from '../../fixture/memberFixture'
import { userMock } from '../../../fixture/memberFixture'

describe('PasswordProvider class', () => {
let passwordProvider: PasswordProvider
Expand Down
2 changes: 1 addition & 1 deletion server/src/members/domain/member.repository.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Test, TestingModule } from '@nestjs/testing'
import { Connection, ResultSetHeader, RowDataPacket } from 'mysql2/promise'
import { MemberRepository } from './member.repository'
import { MYSQL_CONNECTION } from '../../database/constants'
import { dbMemberMock, userMock } from '../../fixture/memberFixture'
import { dbMemberMock, userMock } from '../../../fixture/memberFixture'

describe('MemberRepository class', () => {
let connection: Connection
Expand Down
2 changes: 1 addition & 1 deletion server/src/members/domain/member.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Member } from './member.entity'
import { userMock } from '../../fixture/memberFixture'
import { userMock } from '../../../fixture/memberFixture'
import { Role } from './member-role.enum'
import { MemberType } from './member-type.enum'

Expand Down
6 changes: 3 additions & 3 deletions server/test/item-create.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import * as request from 'supertest'
import { ItemCreater } from '../src/items/application/item.creater'
import { ItemReader } from '../src/items/application/item.reader'
import { ItemUpdater } from '../src/items/application/item.updater'
import { itemMock } from '../src/fixture/itemFixture'
import { itemMock } from '../fixture/itemFixture'
import { ItemUpdateController } from '../src/items/web/item-update.controller'
import { ItemDetailController } from '../src/items/web/item-detail.controller'
import { ItemCreateController } from '../src/items/web/item-create.controller'
Expand All @@ -20,9 +20,9 @@ import { MYSQL_CONNECTION } from '../src/database/constants'
import { Connection } from 'mysql2/promise'
import { CreateItemRequest } from '../src/items/dto/save-item.dto'
import { MemberRepository } from '../src/members/domain/member.repository'
import { userMock } from '../src/fixture/memberFixture'
import { userMock } from '../fixture/memberFixture'
import { JwtAuthGuard } from '../src/config/auth/guards/jwt-auth.guard'
import { jwtTokenFixture } from '../src/fixture/jwtTokenFixture'
import { jwtTokenFixture } from '../fixture/jwtTokenFixture'
import { JwtProvider } from '../src/jwt/jwt.provider'
import { RolesGuard } from '../src/config/auth/guards/role-auth.guard'
import { when } from 'jest-when'
Expand Down
6 changes: 3 additions & 3 deletions server/test/item-detail.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ import * as request from 'supertest'
import { ItemCreater } from '../src/items/application/item.creater'
import { ItemReader } from '../src/items/application/item.reader'
import { ItemUpdater } from '../src/items/application/item.updater'
import { itemMock } from '../src/fixture/itemFixture'
import { itemMock } from '../fixture/itemFixture'
import { ItemUpdateController } from '../src/items/web/item-update.controller'
import { ItemDetailController } from '../src/items/web/item-detail.controller'
import { ItemCreateController } from '../src/items/web/item-create.controller'
import { ItemRepository } from '../src/items/domain/item.repository'
import { MYSQL_CONNECTION } from '../src/database/constants'
import { Connection } from 'mysql2/promise'
import { MemberRepository } from '../src/members/domain/member.repository'
import { userMock } from '../src/fixture/memberFixture'
import { userMock } from '../fixture/memberFixture'
import { JwtAuthGuard } from '../src/config/auth/guards/jwt-auth.guard'
import { jwtTokenFixture } from '../src/fixture/jwtTokenFixture'
import { jwtTokenFixture } from '../fixture/jwtTokenFixture'
import { JwtProvider } from '../src/jwt/jwt.provider'
import { RolesGuard } from '../src/config/auth/guards/role-auth.guard'
import { when } from 'jest-when'
Expand Down
Loading

0 comments on commit be26a9d

Please sign in to comment.