@@ -42,7 +42,8 @@ const InboxType = new GraphQLObjectType({
42
42
} ,
43
43
unread : {
44
44
type : GraphQLInt ,
45
- resolve : ( inbox ) => inbox . emails . filter ( ( email ) => email . unread ) . length ,
45
+ resolve : ( inbox ) =>
46
+ inbox . emails . filter ( ( email : any ) => email . unread ) . length ,
46
47
} ,
47
48
emails : { type : new GraphQLList ( EmailType ) } ,
48
49
} ,
@@ -103,7 +104,7 @@ function createSubscription(pubsub: SimplePubSub<Email>) {
103
104
} ,
104
105
] ;
105
106
106
- const data = {
107
+ const data : any = {
107
108
inbox : { emails } ,
108
109
// FIXME: we shouldn't use mapAsyncIterator here since it makes tests way more complex
109
110
importantEmail : pubsub . getSubscriber ( ( newEmail ) => {
@@ -122,7 +123,7 @@ function createSubscription(pubsub: SimplePubSub<Email>) {
122
123
}
123
124
124
125
async function expectPromise ( promise : Promise < unknown > ) {
125
- let caughtError ;
126
+ let caughtError : Error ;
126
127
127
128
try {
128
129
await promise ;
@@ -136,7 +137,7 @@ async function expectPromise(promise: Promise<unknown>) {
136
137
toReject ( ) {
137
138
expect ( caughtError ) . to . be . an . instanceOf ( Error ) ;
138
139
} ,
139
- toRejectWith ( message ) {
140
+ toRejectWith ( message : string ) {
140
141
expect ( caughtError ) . to . be . an . instanceOf ( Error ) ;
141
142
expect ( caughtError ) . to . have . property ( 'message' , message ) ;
142
143
} ,
@@ -312,6 +313,7 @@ describe('Subscription Initialization Phase', () => {
312
313
} ) ,
313
314
} ) ;
314
315
316
+ // TODO ts-expect-error (schema must not be null)
315
317
( await expectPromise ( subscribe ( { schema : null , document } ) ) ) . toRejectWith (
316
318
'Expected null to be a GraphQL schema.' ,
317
319
) ;
@@ -321,6 +323,7 @@ describe('Subscription Initialization Phase', () => {
321
323
'Expected undefined to be a GraphQL schema.' ,
322
324
) ;
323
325
326
+ // TODO ts-expect-error (document must not be null)
324
327
( await expectPromise ( subscribe ( { schema, document : null } ) ) ) . toRejectWith (
325
328
'Must provide document.' ,
326
329
) ;
0 commit comments