Skip to content

Commit be654b5

Browse files
authored
Unite tests for graphqlSync in one place (#2462)
1 parent d409a01 commit be654b5

File tree

2 files changed

+11
-18
lines changed

2 files changed

+11
-18
lines changed

src/__tests__/graphql-test.js

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/execution/__tests__/sync-test.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,17 @@ describe('Execute: synchronously when possible', () => {
9393
});
9494

9595
describe('graphqlSync', () => {
96+
it('report errors raised during schema validation', () => {
97+
const badSchema = new GraphQLSchema({});
98+
const result = graphqlSync({
99+
schema: badSchema,
100+
source: '{ __typename }',
101+
});
102+
expect(result).to.deep.equal({
103+
errors: [{ message: 'Query root type must be provided.' }],
104+
});
105+
});
106+
96107
it('does not return a Promise for syntax errors', () => {
97108
const doc = 'fragment Example on Query { { { syncField }';
98109
const result = graphqlSync({

0 commit comments

Comments
 (0)