Skip to content

Commit

Permalink
Merge pull request #34 from contentstack/Test-case-fix
Browse files Browse the repository at this point in the history
Failing tests fixed
  • Loading branch information
praveen-mohan-cs authored Oct 18, 2024
2 parents 3073105 + 207a546 commit 6eabf55
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentstack/types-generator",
"version": "2.0.1",
"version": "2.0.2",
"description": "Contentstack type definition generation library",
"private": false,
"author": "Contentstack",
Expand Down
2 changes: 1 addition & 1 deletion src/graphqlTS/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/graphqlTS/graphqlTS.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 6eabf55

Please sign in to comment.