@@ -5,53 +5,53 @@ import { parse } from '../../language/parser';
5
5
6
6
import { buildSchema } from '../../utilities/buildASTSchema' ;
7
7
8
- import { execute } from '../execute' ;
8
+ import { execute , executeSync } from '../execute' ;
9
9
10
10
describe ( 'Execute: Accepts any iterable as list value' , ( ) => {
11
11
function complete ( rootValue : mixed ) {
12
- return execute ( {
12
+ return executeSync ( {
13
13
schema : buildSchema ( 'type Query { listField: [String] }' ) ,
14
14
document : parse ( '{ listField }' ) ,
15
15
rootValue,
16
16
} ) ;
17
17
}
18
18
19
- it ( 'Accepts a Set as a List value' , async ( ) => {
19
+ it ( 'Accepts a Set as a List value' , ( ) => {
20
20
const listField = new Set ( [ 'apple' , 'banana' , 'apple' , 'coconut' ] ) ;
21
21
22
- expect ( await complete ( { listField } ) ) . to . deep . equal ( {
22
+ expect ( complete ( { listField } ) ) . to . deep . equal ( {
23
23
data : { listField : [ 'apple' , 'banana' , 'coconut' ] } ,
24
24
} ) ;
25
25
} ) ;
26
26
27
- it ( 'Accepts an Generator function as a List value' , async ( ) => {
27
+ it ( 'Accepts an Generator function as a List value' , ( ) => {
28
28
function * yieldItems ( ) {
29
29
yield 'one' ;
30
30
yield 2 ;
31
31
yield true ;
32
32
}
33
33
const listField = yieldItems ( ) ;
34
34
35
- expect ( await complete ( { listField } ) ) . to . deep . equal ( {
35
+ expect ( complete ( { listField } ) ) . to . deep . equal ( {
36
36
data : { listField : [ 'one' , '2' , 'true' ] } ,
37
37
} ) ;
38
38
} ) ;
39
39
40
- it ( 'Accepts function arguments as a List value' , async ( ) => {
40
+ it ( 'Accepts function arguments as a List value' , ( ) => {
41
41
function getArgs ( ...args : Array < string > ) {
42
42
return args ;
43
43
}
44
44
const listField = getArgs ( 'one' , 'two' ) ;
45
45
46
- expect ( await complete ( { listField } ) ) . to . deep . equal ( {
46
+ expect ( complete ( { listField } ) ) . to . deep . equal ( {
47
47
data : { listField : [ 'one' , 'two' ] } ,
48
48
} ) ;
49
49
} ) ;
50
50
51
- it ( 'Does not accept (Iterable) String-literal as a List value' , async ( ) => {
51
+ it ( 'Does not accept (Iterable) String-literal as a List value' , ( ) => {
52
52
const listField = 'Singular' ;
53
53
54
- expect ( await complete ( { listField } ) ) . to . deep . equal ( {
54
+ expect ( complete ( { listField } ) ) . to . deep . equal ( {
55
55
data : { listField : null } ,
56
56
errors : [
57
57
{
0 commit comments