@@ -102,43 +102,43 @@ describe('mergeIncrementalResult', () => {
102102 it ( 'should add errors' , ( ) => {
103103 const executionResult = { data : { user : { name : 'John' } } } ;
104104 const incrementalResult = {
105- errors : [ new GraphQLError ( 'error 1' ) , new GraphQLError ( 'error 2' ) ] ,
105+ errors : [ createGraphQLError ( 'error 1' ) , createGraphQLError ( 'error 2' ) ] ,
106106 } ;
107107
108108 mergeIncrementalResult ( { incrementalResult, executionResult } ) ;
109109
110110 expect ( executionResult ) . toEqual ( {
111111 data : { user : { name : 'John' } } ,
112- errors : [ new GraphQLError ( 'error 1' ) , new GraphQLError ( 'error 2' ) ] ,
112+ errors : [ createGraphQLError ( 'error 1' ) , createGraphQLError ( 'error 2' ) ] ,
113113 } ) ;
114114 } ) ;
115115
116116 it ( 'should keep errors' , ( ) => {
117- const executionResult = { errors : [ new GraphQLError ( 'error 1' ) ] } ;
117+ const executionResult = { errors : [ createGraphQLError ( 'error 1' ) ] } ;
118118 const incrementalResult = { data : { user : { name : 'John' } } , path : [ ] } ;
119119
120120 mergeIncrementalResult ( { incrementalResult, executionResult } ) ;
121121
122122 expect ( executionResult ) . toEqual ( {
123123 data : { user : { name : 'John' } } ,
124- errors : [ new GraphQLError ( 'error 1' ) ] ,
124+ errors : [ createGraphQLError ( 'error 1' ) ] ,
125125 } ) ;
126126 } ) ;
127127
128128 it ( 'should merge errors' , ( ) => {
129- const executionResult = { errors : [ new GraphQLError ( 'error 1' ) ] } ;
129+ const executionResult = { errors : [ createGraphQLError ( 'error 1' ) ] } ;
130130
131131 const incrementalResult = {
132- errors : [ new GraphQLError ( 'error 2' ) , new GraphQLError ( 'error 3' ) ] ,
132+ errors : [ createGraphQLError ( 'error 2' ) , createGraphQLError ( 'error 3' ) ] ,
133133 } ;
134134
135135 mergeIncrementalResult ( { incrementalResult, executionResult } ) ;
136136
137137 expect ( executionResult ) . toEqual ( {
138138 errors : [
139- new GraphQLError ( 'error 1' ) ,
140- new GraphQLError ( 'error 2' ) ,
141- new GraphQLError ( 'error 3' ) ,
139+ createGraphQLError ( 'error 1' ) ,
140+ createGraphQLError ( 'error 2' ) ,
141+ createGraphQLError ( 'error 3' ) ,
142142 ] ,
143143 } ) ;
144144 } ) ;
0 commit comments