Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphQLError-test: merge check of source with rest of the properties #3324

Merged
merged 1 commit into from Oct 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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