From 54650f8e6609151c0c46dde9f0962db5934a7117 Mon Sep 17 00:00:00 2001 From: sunil-lakshman <104969541+sunil-lakshman@users.noreply.github.com> Date: Fri, 31 Oct 2025 12:30:29 +0530 Subject: [PATCH] fix: Fixed unit testcases --- src/lib/contentstack-core.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/lib/contentstack-core.ts b/src/lib/contentstack-core.ts index 7197ea1..d1f18ef 100644 --- a/src/lib/contentstack-core.ts +++ b/src/lib/contentstack-core.ts @@ -14,13 +14,16 @@ export function httpClient(options: HttpClientParams): AxiosInstance { httpsAgent: false, timeout: 30000, logHandler: (level: string, data?: any) => { - if (level === 'error' && data) { - const title = [data.name, data.message].filter((a) => a).join(' - '); - console.error(`[error] ${title}`); - + if (level === 'error') { + if (data) { + const title = [data.name, data.message].filter((a) => a).join(' - '); + console.error(`[error] ${title}`); + } return; } - console.log(`[${level}] ${data}`); + if (data !== undefined) { + console.log(`[${level}] ${data}`); + } }, retryCondition: (error: any) => { if (error.response && error.response.status === 429) {