From d145227621792d5b62d70f578206835f573856e8 Mon Sep 17 00:00:00 2001 From: BangDori Date: Fri, 10 May 2024 19:41:22 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=9D=91=EB=8B=B5=20=EC=8B=9C=EA=B0=84?= =?UTF-8?q?=20=EB=B3=80=EC=88=98=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/mocks/dir/response.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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( {