From 76497901bc723ffb739a30e27bb843dc7476273a Mon Sep 17 00:00:00 2001 From: MohammedZuhairAhmed Date: Fri, 18 Oct 2024 15:54:55 +0530 Subject: [PATCH] Failing tests fixed --- src/graphqlTS/index.ts | 2 +- tests/unit/graphqlTS/graphqlTS.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/graphqlTS/index.ts b/src/graphqlTS/index.ts index 63e7d81..cdd5da8 100644 --- a/src/graphqlTS/index.ts +++ b/src/graphqlTS/index.ts @@ -74,7 +74,7 @@ export async function graphqlTS({ if (error.message && !error.response) { throw { error_message: error.message }; } - if (error.response.status === 401) { + if (error.response.status === 412) { throw { error_message: "Unauthorized: The apiKey, token or environment is not valid.", diff --git a/tests/unit/graphqlTS/graphqlTS.test.ts b/tests/unit/graphqlTS/graphqlTS.test.ts index 725f59c..40ae14e 100644 --- a/tests/unit/graphqlTS/graphqlTS.test.ts +++ b/tests/unit/graphqlTS/graphqlTS.test.ts @@ -103,7 +103,7 @@ describe("graphqlTS function with errors", () => { nock(GRAPHQL_REGION_URL_MAPPING[region]) .post(`/${apiKey}?environment=${environment}`) - .reply(401); + .reply(412); try { await graphqlTS({