Skip to content

Commit

Permalink
apollo-server-express: fix tests to include error code
Browse files Browse the repository at this point in the history
  • Loading branch information
evans committed May 3, 2018
1 parent 387f0cd commit ba5ed13
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/apollo-server-express/src/apolloServerHttp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,9 @@ describe(`GraphQL-HTTP (apolloServer) tests for ${version} express`, () => {
data: null,
errors: [
{
extensions: {
code: 'INTERNAL_SERVER_ERROR',
},
message: 'Throws!',
locations: [{ line: 1, column: 2 }],
path: ['thrower'],
Expand Down Expand Up @@ -359,6 +362,9 @@ describe(`GraphQL-HTTP (apolloServer) tests for ${version} express`, () => {
expect(JSON.parse(response.text)).to.deep.equal({
errors: [
{
extensions: {
code: 'GRAPHQL_VALIDATION_FAILED',
},
message: 'Cannot query field "notExists" on type "QueryRoot".',
locations: [{ line: 1, column: 2 }],
},
Expand All @@ -385,6 +391,9 @@ describe(`GraphQL-HTTP (apolloServer) tests for ${version} express`, () => {
expect(JSON.parse(response.text)).to.deep.equal({
errors: [
{
extensions: {
code: 'GRAPHQL_VALIDATION_FAILED',
},
message: 'Cannot query field "notExists" on type "QueryRoot".',
locations: [{ line: 1, column: 2 }],
},
Expand Down Expand Up @@ -532,6 +541,9 @@ describe(`GraphQL-HTTP (apolloServer) tests for ${version} express`, () => {
expect(JSON.parse(response.text)).to.deep.equal({
errors: [
{
extensions: {
code: 'GRAPHQL_VALIDATION_FAILED',
},
message: 'AlwaysInvalidRule was really invalid!',
},
],
Expand Down

0 comments on commit ba5ed13

Please sign in to comment.