1
- /* eslint-disable node/no-missing-import, import/no-unresolved */
1
+ /* eslint-disable node/no-missing-import, import/no-unresolved, node/no-unsupported-features/es-syntax */
2
2
3
3
import { deepStrictEqual , strictEqual } from 'assert' ;
4
4
5
- // Regular import
5
+ import { version } from 'version' ;
6
+ import { schema } from 'schema' ;
7
+
6
8
import { graphqlSync } from 'graphql' ;
7
- // Import with explicit extension
8
- import { version } from 'graphql/version.js' ;
9
- // _/index.js import
10
- import { buildSchema } from 'graphql/utilities' ;
9
+
11
10
// Import without explicit extension
12
11
import { isPromise } from 'graphql/jsutils/isPromise' ;
13
12
@@ -16,8 +15,6 @@ import pkg from 'graphql/package.json';
16
15
17
16
deepStrictEqual ( version , pkg . version ) ;
18
17
19
- const schema = buildSchema ( 'type Query { hello: String }' ) ;
20
-
21
18
const result = graphqlSync ( {
22
19
schema,
23
20
source : '{ hello }' ,
@@ -34,6 +31,6 @@ deepStrictEqual(result, {
34
31
strictEqual ( isPromise ( Promise . resolve ( ) ) , true ) ;
35
32
36
33
// The possible promise rejection is handled by "--unhandled-rejections=strict"
37
- import ( 'graphql/jsutils/isPromise' ) . then ( ( { isPromise } ) => {
38
- strictEqual ( isPromise ( Promise . resolve ( ) ) , true ) ;
34
+ import ( 'graphql/jsutils/isPromise' ) . then ( ( isPromisePkg ) => {
35
+ strictEqual ( isPromisePkg . isPromise ( Promise . resolve ( ) ) , true ) ;
39
36
} ) ;
0 commit comments