From f88629c973d449bcaf929a125ccd704b0f0d038f Mon Sep 17 00:00:00 2001 From: Wisley Alves Date: Thu, 24 Aug 2023 13:17:13 -0300 Subject: [PATCH] chore(btw): Add try/cath debug --- .../tests/calculate-shipping.test.mjs | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/packages/apps/correios/tests/calculate-shipping.test.mjs b/packages/apps/correios/tests/calculate-shipping.test.mjs index 371fbbe29..ff4b62e4b 100644 --- a/packages/apps/correios/tests/calculate-shipping.test.mjs +++ b/packages/apps/correios/tests/calculate-shipping.test.mjs @@ -12,15 +12,19 @@ describe('Test Shipping Calculation in the Correios App', async () => { const appId = 1248; before(async () => { - req = await fetch(`${modulesUrl}/calculate_shipping?app_id=${appId}`, { - method: 'POST', - body: JSON.stringify(bodyCalculateShipping), - headers: { - 'Content-Type': 'application/json', - }, - }); - - data = (await req.json()).result; + try { + req = await fetch(`${modulesUrl}/calculate_shipping?app_id=${appId}`, { + method: 'POST', + body: JSON.stringify(bodyCalculateShipping), + headers: { + 'Content-Type': 'application/json', + }, + }); + + data = (await req.json()).result; + } catch (err) { + console.error(err); + } console.log('>> ', req, ' ', data); });