diff --git a/src/app/mocks/dir/response.ts b/src/app/mocks/dir/response.ts index 5498416..d50cd38 100644 --- a/src/app/mocks/dir/response.ts +++ b/src/app/mocks/dir/response.ts @@ -2,8 +2,11 @@ import { HttpResponse, delay } from 'msw'; import { errorMessage } from '../consts/error'; +/** 0 <= 응답 시간 <= 4초 */ +const delayTime = Math.random() * 4001; + export async function createHttpSuccessResponse(data: T) { - await delay(); + await delay(delayTime); return HttpResponse.json( { @@ -15,7 +18,7 @@ export async function createHttpSuccessResponse(data: T) { } export async function createHttpErrorResponse(code: keyof typeof errorMessage) { - await delay(); + await delay(delayTime); return HttpResponse.json( {