Skip to content

Commit

Permalink
fix: fixed test-case to run in older node versions and ran prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
stenreijers committed Jan 31, 2023
1 parent 1219dec commit a982330
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/execution/__tests__/variables-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ const TestFaultyScalarGraphQLError = new GraphQLError(
'FaultyScalarErrorMessage',
{
extensions: {
code: 'FaultyScalarErrorExtensionCode'
}
}
code: 'FaultyScalarErrorExtensionCode',
},
},
);

const TestFaultyScalar = new GraphQLScalarType({
Expand Down Expand Up @@ -66,7 +66,7 @@ const TestInputObject = new GraphQLInputObjectType({
b: { type: new GraphQLList(GraphQLString) },
c: { type: new GraphQLNonNull(GraphQLString) },
d: { type: TestComplexScalar },
e: { type: TestFaultyScalar }
e: { type: TestFaultyScalar },
},
});

Expand Down Expand Up @@ -268,7 +268,6 @@ describe('Execute: Handles inputs', () => {
},
],
});

});
});

Expand Down Expand Up @@ -415,15 +414,15 @@ describe('Execute: Handles inputs', () => {
const params = { input: { c: 'foo', e: 'SerializedValue' } };
const result = executeQuery(doc, params);

expect(result.errors?.at(0)?.originalError).to.equal(TestFaultyScalarGraphQLError);
expectJSON(result).toDeepEqual({
errors: [
{
message: 'Variable "$input" got invalid value "SerializedValue" at "input.e"; FaultyScalarErrorMessage',
message:
'Variable "$input" got invalid value "SerializedValue" at "input.e"; FaultyScalarErrorMessage',
locations: [{ line: 2, column: 16 }],
extensions: { code: 'FaultyScalarErrorExtensionCode' }
}
]
extensions: { code: 'FaultyScalarErrorExtensionCode' },
},
],
});
});

Expand Down

0 comments on commit a982330

Please sign in to comment.