@@ -118,7 +118,6 @@ const PetType = new GraphQLUnionType({
118
118
if ( value instanceof Cat ) {
119
119
return CatType . name ;
120
120
}
121
- /* c8 ignore next 3 */
122
121
// Not reachable, all possible types have been considered.
123
122
expect . fail ( 'Not reachable' ) ;
124
123
} ,
@@ -169,14 +168,10 @@ const TypeA = new GraphQLObjectType({
169
168
nameA : { type : GraphQLString } ,
170
169
} ) ,
171
170
isTypeOf : ( _value , _context , _info ) =>
172
- new Promise (
173
- ( _resolve , reject ) =>
174
- void setTimeout (
175
- ( ) => void reject ( new Error ( "TypeA_isTypeOf_rejected" ) ) ,
176
- 10 ,
177
- ) ,
171
+ new Promise ( ( _resolve , reject ) =>
172
+ // eslint-disable-next-line
173
+ setTimeout ( ( ) => reject ( new Error ( 'TypeA_isTypeOf_rejected' ) ) , 10 ) ,
178
174
) ,
179
- } ,
180
175
} ) ;
181
176
182
177
const TypeB = new GraphQLObjectType ( {
@@ -186,9 +181,7 @@ const TypeB = new GraphQLObjectType({
186
181
id : { type : GraphQLString } ,
187
182
nameB : { type : GraphQLString } ,
188
183
} ) ,
189
- isTypeOf : ( value : any , _context , _info ) => {
190
- return value . id === 'b' ;
191
- } ,
184
+ isTypeOf : ( value : any , _context , _info ) => value . id === 'b' ,
192
185
} ) ;
193
186
194
187
const queryTypeWithSearchable = new GraphQLObjectType ( {
@@ -202,10 +195,8 @@ const queryTypeWithSearchable = new GraphQLObjectType({
202
195
type : SearchableInterface ,
203
196
args : { id : { type : GraphQLString } } ,
204
197
resolve : ( _source , { id } ) => {
205
- /* c8 ignore start */
206
198
if ( id === 'a' ) {
207
199
return { id : 'a' , nameA : 'Object A' } ;
208
- /* c8 ignore end */
209
200
} else if ( id === 'b' ) {
210
201
return { id : 'b' , nameB : 'Object B' } ;
211
202
}
@@ -636,19 +627,18 @@ describe('Execute: Union and intersection types', () => {
636
627
` ) ;
637
628
638
629
let unhandledRejection : any = null ;
639
- /* c8 ignore start */
640
630
const unhandledRejectionListener = ( reason : any ) => {
641
631
unhandledRejection = reason ;
642
632
} ;
633
+ // eslint-disable-next-line
643
634
process . on ( 'unhandledRejection' , unhandledRejectionListener ) ;
644
- /* c8 ignore end */
645
635
646
636
const result = await execute ( {
647
637
schema : schemaWithSearchable ,
648
638
document,
649
639
} ) ;
650
640
651
- expect ( result . errors ) . to . be . undefined ;
641
+ expect ( result . errors ) . to . equal ( undefined ) ;
652
642
expect ( result . data ) . to . deep . equal ( {
653
643
search : {
654
644
__typename : 'TypeB' ,
@@ -658,10 +648,12 @@ describe('Execute: Union and intersection types', () => {
658
648
} ) ;
659
649
660
650
// Give the TypeA promise a chance to reject and the listener to fire
651
+ // eslint-disable-next-line
661
652
await new Promise ( ( resolve ) => setTimeout ( resolve , 20 ) ) ;
662
653
654
+ // eslint-disable-next-line
663
655
process . removeListener ( 'unhandledRejection' , unhandledRejectionListener ) ;
664
656
665
- expect ( unhandledRejection ) . to . be . null ;
657
+ expect ( unhandledRejection ) . to . equal ( null ) ;
666
658
} ) ;
667
659
} ) ;
0 commit comments