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

Using direct imports in test files #2060

Merged
merged 1 commit into from Jul 29, 2019
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/__tests__/starWarsSchema.js
@@ -1,14 +1,14 @@
// @flow strict

import { GraphQLSchema } from '../type/schema';
import { GraphQLString } from '../type/scalars';
import {
GraphQLList,
GraphQLNonNull,
GraphQLEnumType,
GraphQLInterfaceType,
GraphQLObjectType,
GraphQLList,
GraphQLNonNull,
GraphQLSchema,
GraphQLString,
} from '../type';
} from '../type/definition';

import { getFriends, getHero, getHuman, getDroid } from './starWarsData';

Expand Down
14 changes: 6 additions & 8 deletions src/error/__tests__/GraphQLError-test.js
Expand Up @@ -6,14 +6,12 @@ import { describe, it } from 'mocha';
import dedent from '../../jsutils/dedent';
import invariant from '../../jsutils/invariant';

import {
Kind,
parse,
Source,
GraphQLError,
printError,
formatError,
} from '../../';
import { Kind } from '../../language/kinds';
import { parse } from '../../language/parser';
import { Source } from '../../language/source';

import { formatError } from '../formatError';
import { GraphQLError, printError } from '../GraphQLError';

const source = new Source(dedent`
{
Expand Down
12 changes: 6 additions & 6 deletions src/execution/__tests__/abstract-promise-test.js
Expand Up @@ -3,16 +3,16 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';

import { GraphQLSchema } from '../../type/schema';
import { GraphQLString, GraphQLBoolean } from '../../type/scalars';
import {
graphql,
GraphQLSchema,
GraphQLList,
GraphQLObjectType,
GraphQLInterfaceType,
GraphQLUnionType,
GraphQLList,
GraphQLString,
GraphQLBoolean,
} from '../../';
} from '../../type/definition';

import { graphql } from '../../graphql';

class Dog {
name: string;
Expand Down
12 changes: 6 additions & 6 deletions src/execution/__tests__/abstract-test.js
Expand Up @@ -3,16 +3,16 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';

import { GraphQLSchema } from '../../type/schema';
import { GraphQLString, GraphQLBoolean } from '../../type/scalars';
import {
graphqlSync,
GraphQLSchema,
GraphQLList,
GraphQLObjectType,
GraphQLInterfaceType,
GraphQLUnionType,
GraphQLList,
GraphQLString,
GraphQLBoolean,
} from '../../';
} from '../../type/definition';

import { graphqlSync } from '../../graphql';

class Dog {
name: string;
Expand Down
7 changes: 5 additions & 2 deletions src/execution/__tests__/directives-test.js
Expand Up @@ -3,8 +3,11 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';

import { parse } from '../../language';
import { GraphQLSchema, GraphQLObjectType, GraphQLString } from '../../type';
import { parse } from '../../language/parser';

import { GraphQLSchema } from '../../type/schema';
import { GraphQLString } from '../../type/scalars';
import { GraphQLObjectType } from '../../type/definition';

import { execute } from '../execute';

Expand Down
16 changes: 8 additions & 8 deletions src/execution/__tests__/executor-test.js
Expand Up @@ -6,17 +6,17 @@ import { describe, it } from 'mocha';
import inspect from '../../jsutils/inspect';
import invariant from '../../jsutils/invariant';

import { Kind, parse } from '../../language';
import { Kind } from '../../language/kinds';
import { parse } from '../../language/parser';

import { GraphQLSchema } from '../../type/schema';
import { GraphQLInt, GraphQLBoolean, GraphQLString } from '../../type/scalars';
import {
GraphQLSchema,
GraphQLInterfaceType,
GraphQLObjectType,
GraphQLList,
GraphQLBoolean,
GraphQLInt,
GraphQLString,
GraphQLNonNull,
} from '../../type';
GraphQLInterfaceType,
GraphQLObjectType,
} from '../../type/definition';

import { execute } from '../execute';

Expand Down
12 changes: 6 additions & 6 deletions src/execution/__tests__/lists-test.js
Expand Up @@ -3,15 +3,15 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';

import { parse } from '../../language';
import { parse } from '../../language/parser';

import { GraphQLSchema } from '../../type/schema';
import { GraphQLString, GraphQLInt } from '../../type/scalars';
import {
GraphQLSchema,
GraphQLObjectType,
GraphQLString,
GraphQLInt,
GraphQLList,
GraphQLNonNull,
} from '../../type';
GraphQLObjectType,
} from '../../type/definition';

import { execute } from '../execute';

Expand Down
7 changes: 5 additions & 2 deletions src/execution/__tests__/mutations-test.js
Expand Up @@ -3,8 +3,11 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';

import { parse } from '../../language';
import { GraphQLSchema, GraphQLObjectType, GraphQLInt } from '../../type';
import { parse } from '../../language/parser';

import { GraphQLInt } from '../../type/scalars';
import { GraphQLSchema } from '../../type/schema';
import { GraphQLObjectType } from '../../type/definition';

import { execute } from '../execute';

Expand Down
13 changes: 6 additions & 7 deletions src/execution/__tests__/nonnull-test.js
Expand Up @@ -3,13 +3,12 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';

import { parse } from '../../language';
import {
GraphQLSchema,
GraphQLObjectType,
GraphQLString,
GraphQLNonNull,
} from '../../type';
import { parse } from '../../language/parser';

import { GraphQLSchema } from '../../type/schema';
import { GraphQLString } from '../../type/scalars';
import { GraphQLNonNull, GraphQLObjectType } from '../../type/definition';

import { buildSchema } from '../../utilities/buildASTSchema';

import { execute } from '../execute';
Expand Down
12 changes: 5 additions & 7 deletions src/execution/__tests__/resolve-test.js
Expand Up @@ -3,13 +3,11 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';

import {
graphqlSync,
GraphQLSchema,
GraphQLObjectType,
GraphQLString,
GraphQLInt,
} from '../../';
import { GraphQLSchema } from '../../type/schema';
import { GraphQLObjectType } from '../../type/definition';
import { GraphQLInt, GraphQLString } from '../../type/scalars';

import { graphqlSync } from '../../graphql';

describe('Execute: resolve function', () => {
function testSchema(testField) {
Expand Down
12 changes: 7 additions & 5 deletions src/execution/__tests__/schema-test.js
Expand Up @@ -3,18 +3,20 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';

import { parse } from '../../language';
import { parse } from '../../language/parser';

import { GraphQLSchema } from '../../type/schema';
import {
GraphQLSchema,
GraphQLObjectType,
GraphQLList,
GraphQLNonNull,
GraphQLObjectType,
} from '../../type/definition';
import {
GraphQLID,
GraphQLInt,
GraphQLString,
GraphQLBoolean,
GraphQLID,
} from '../../type';
} from '../../type/scalars';

import { execute } from '../execute';

Expand Down
9 changes: 7 additions & 2 deletions src/execution/__tests__/sync-test.js
Expand Up @@ -3,9 +3,14 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';

import { parse } from '../../language';
import { parse } from '../../language/parser';

import { validate } from '../../validation/validate';
import { GraphQLSchema, GraphQLObjectType, GraphQLString } from '../../type';

import { GraphQLSchema } from '../../type/schema';
import { GraphQLString } from '../../type/scalars';
import { GraphQLObjectType } from '../../type/definition';

import { graphqlSync } from '../../graphql';

import { execute } from '../execute';
Expand Down
12 changes: 6 additions & 6 deletions src/execution/__tests__/union-interface-test.js
Expand Up @@ -3,16 +3,16 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';

import { parse } from '../../language';
import { parse } from '../../language/parser';

import { GraphQLSchema } from '../../type/schema';
import { GraphQLString, GraphQLBoolean } from '../../type/scalars';
import {
GraphQLSchema,
GraphQLList,
GraphQLObjectType,
GraphQLInterfaceType,
GraphQLUnionType,
GraphQLList,
GraphQLString,
GraphQLBoolean,
} from '../../type';
} from '../../type/definition';

import { execute } from '../execute';

Expand Down
13 changes: 7 additions & 6 deletions src/execution/__tests__/variables-test.js
Expand Up @@ -5,17 +5,18 @@ import { describe, it } from 'mocha';

import inspect from '../../jsutils/inspect';

import { parse } from '../../language';
import { parse } from '../../language/parser';

import { GraphQLSchema } from '../../type/schema';
import { GraphQLString } from '../../type/scalars';
import {
GraphQLSchema,
GraphQLObjectType,
GraphQLInputObjectType,
GraphQLList,
GraphQLString,
GraphQLNonNull,
GraphQLScalarType,
GraphQLObjectType,
GraphQLInputObjectType,
GraphQLEnumType,
} from '../../type';
} from '../../type/definition';

import { execute } from '../execute';

Expand Down
2 changes: 1 addition & 1 deletion src/language/__tests__/lexer-test.js
Expand Up @@ -8,7 +8,7 @@ import { describe, it } from 'mocha';
import dedent from '../../jsutils/dedent';
import inspect from '../../jsutils/inspect';

import { GraphQLError } from '../../error';
import { GraphQLError } from '../../error/GraphQLError';

import { Source } from '../source';
import { TokenKind } from '../tokenKind';
Expand Down
3 changes: 1 addition & 2 deletions src/language/__tests__/printLocation-test.js
Expand Up @@ -5,8 +5,7 @@ import { describe, it } from 'mocha';

import dedent from '../../jsutils/dedent';

import { Source } from '../../language';

import { Source } from '../source';
import { printSourceLocation } from '../printLocation';

describe('printSourceLocation', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/language/__tests__/visitor-test.js
Expand Up @@ -3,7 +3,7 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';

import { getNamedType, isCompositeType } from '../../type';
import { getNamedType, isCompositeType } from '../../type/definition';
import { TypeInfo } from '../../utilities/TypeInfo';

import { Kind } from '../kinds';
Expand Down
17 changes: 7 additions & 10 deletions src/subscription/__tests__/subscribe-test.js
Expand Up @@ -5,16 +5,13 @@ import EventEmitter from 'events';
import { expect } from 'chai';
import { describe, it } from 'mocha';

import { parse } from '../../language';
import { GraphQLError } from '../../error';
import {
GraphQLSchema,
GraphQLObjectType,
GraphQLList,
GraphQLBoolean,
GraphQLInt,
GraphQLString,
} from '../../type';
import { parse } from '../../language/parser';

import { GraphQLError } from '../../error/GraphQLError';

import { GraphQLSchema } from '../../type/schema';
import { GraphQLList, GraphQLObjectType } from '../../type/definition';
import { GraphQLInt, GraphQLString, GraphQLBoolean } from '../../type/scalars';

import { createSourceEventStream, subscribe } from '../subscribe';

Expand Down
3 changes: 2 additions & 1 deletion src/type/__tests__/directive-test.js
Expand Up @@ -3,7 +3,8 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';

import { GraphQLDirective, GraphQLString, GraphQLInt } from '../';
import { GraphQLDirective } from '../directives';
import { GraphQLString, GraphQLInt } from '../scalars';

describe('Type System: Directive', () => {
it('defines a directive with no args', () => {
Expand Down
16 changes: 6 additions & 10 deletions src/type/__tests__/enumType-test.js
Expand Up @@ -3,16 +3,12 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';

import {
graphqlSync,
GraphQLSchema,
GraphQLEnumType,
GraphQLObjectType,
GraphQLInt,
GraphQLString,
GraphQLBoolean,
introspectionFromSchema,
} from '../../';
import { graphqlSync } from '../../graphql';
import { introspectionFromSchema } from '../../utilities/introspectionFromSchema';

import { GraphQLSchema } from '../schema';
import { GraphQLEnumType, GraphQLObjectType } from '../definition';
import { GraphQLInt, GraphQLString, GraphQLBoolean } from '../scalars';

const ColorType = new GraphQLEnumType({
name: 'Color',
Expand Down