Skip to content

Unite tests for graphqlSync in one place #2462

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

Merged
merged 1 commit into from
Mar 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions src/__tests__/graphql-test.js

This file was deleted.

11 changes: 11 additions & 0 deletions src/execution/__tests__/sync-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,17 @@ describe('Execute: synchronously when possible', () => {
});

describe('graphqlSync', () => {
it('report errors raised during schema validation', () => {
const badSchema = new GraphQLSchema({});
const result = graphqlSync({
schema: badSchema,
source: '{ __typename }',
});
expect(result).to.deep.equal({
errors: [{ message: 'Query root type must be provided.' }],
});
});

it('does not return a Promise for syntax errors', () => {
const doc = 'fragment Example on Query { { { syncField }';
const result = graphqlSync({
Expand Down