Skip to content

Commit

Permalink
GraphQLError-test: merge check of source with rest of the properties (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov committed Oct 20, 2021
1 parent cd35c99 commit a3d215b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/error/__tests__/GraphQLError-test.ts
Expand Up @@ -72,8 +72,8 @@ describe('GraphQLError', () => {

it('converts nodes to positions and locations', () => {
const e = new GraphQLError('msg', [fieldNode]);
expect(e).to.have.property('source', source);
expect(e).to.deep.include({
source,
nodes: [fieldNode],
positions: [4],
locations: [{ line: 2, column: 3 }],
Expand All @@ -82,8 +82,8 @@ describe('GraphQLError', () => {

it('converts single node to positions and locations', () => {
const e = new GraphQLError('msg', fieldNode); // Non-array value.
expect(e).to.have.property('source', source);
expect(e).to.deep.include({
source,
nodes: [fieldNode],
positions: [4],
locations: [{ line: 2, column: 3 }],
Expand All @@ -92,8 +92,8 @@ describe('GraphQLError', () => {

it('converts node with loc.start === 0 to positions and locations', () => {
const e = new GraphQLError('msg', operationNode);
expect(e).to.have.property('source', source);
expect(e).to.deep.include({
source,
nodes: [operationNode],
positions: [0],
locations: [{ line: 1, column: 1 }],
Expand All @@ -102,8 +102,8 @@ describe('GraphQLError', () => {

it('converts source and positions to locations', () => {
const e = new GraphQLError('msg', null, source, [6]);
expect(e).to.have.property('source', source);
expect(e).to.deep.include({
source,
nodes: undefined,
positions: [6],
locations: [{ line: 2, column: 5 }],
Expand Down

0 comments on commit a3d215b

Please sign in to comment.