@@ -1939,7 +1939,9 @@ describe('Execute: stream directive', () => {
1939
1939
hasNext : true ,
1940
1940
} ) ;
1941
1941
1942
- const result2 = await iterator . next ( ) ;
1942
+ const result2Promise = iterator . next ( ) ;
1943
+ resolveIterableCompletion ( null ) ;
1944
+ const result2 = await result2Promise ;
1943
1945
expectJSON ( result2 ) . toDeepEqual ( {
1944
1946
value : {
1945
1947
pending : [ { id : '2' , path : [ 'friendList' , 1 ] , label : 'DeferName' } ] ,
@@ -1960,7 +1962,7 @@ describe('Execute: stream directive', () => {
1960
1962
} ) ;
1961
1963
1962
1964
const result3Promise = iterator . next ( ) ;
1963
- resolveIterableCompletion ( null ) ;
1965
+ resolveSlowField ( 'Han' ) ;
1964
1966
const result3 = await result3Promise ;
1965
1967
expectJSON ( result3 ) . toDeepEqual ( {
1966
1968
value : {
@@ -1969,9 +1971,7 @@ describe('Execute: stream directive', () => {
1969
1971
} ,
1970
1972
done : false ,
1971
1973
} ) ;
1972
- const result4Promise = iterator . next ( ) ;
1973
- resolveSlowField ( 'Han' ) ;
1974
- const result4 = await result4Promise ;
1974
+ const result4 = await iterator . next ( ) ;
1975
1975
expectJSON ( result4 ) . toDeepEqual ( {
1976
1976
value : {
1977
1977
incremental : [
@@ -2062,19 +2062,8 @@ describe('Execute: stream directive', () => {
2062
2062
done : false ,
2063
2063
} ) ;
2064
2064
2065
- const result3Promise = iterator . next ( ) ;
2066
- resolveIterableCompletion ( null ) ;
2067
- const result3 = await result3Promise ;
2065
+ const result3 = await iterator . next ( ) ;
2068
2066
expectJSON ( result3 ) . toDeepEqual ( {
2069
- value : {
2070
- completed : [ { id : '1' } ] ,
2071
- hasNext : true ,
2072
- } ,
2073
- done : false ,
2074
- } ) ;
2075
-
2076
- const result4 = await iterator . next ( ) ;
2077
- expectJSON ( result4 ) . toDeepEqual ( {
2078
2067
value : {
2079
2068
incremental : [
2080
2069
{
@@ -2083,6 +2072,17 @@ describe('Execute: stream directive', () => {
2083
2072
} ,
2084
2073
] ,
2085
2074
completed : [ { id : '2' } ] ,
2075
+ hasNext : true ,
2076
+ } ,
2077
+ done : false ,
2078
+ } ) ;
2079
+
2080
+ const result4Promise = iterator . next ( ) ;
2081
+ resolveIterableCompletion ( null ) ;
2082
+ const result4 = await result4Promise ;
2083
+ expectJSON ( result4 ) . toDeepEqual ( {
2084
+ value : {
2085
+ completed : [ { id : '1' } ] ,
2086
2086
hasNext : false ,
2087
2087
} ,
2088
2088
done : false ,
0 commit comments