@@ -42,7 +42,8 @@ const InboxType = new GraphQLObjectType({
4242 } ,
4343 unread : {
4444 type : GraphQLInt ,
45- resolve : ( inbox ) => inbox . emails . filter ( ( email ) => email . unread ) . length ,
45+ resolve : ( inbox ) =>
46+ inbox . emails . filter ( ( email : any ) => email . unread ) . length ,
4647 } ,
4748 emails : { type : new GraphQLList ( EmailType ) } ,
4849 } ,
@@ -103,7 +104,7 @@ function createSubscription(pubsub: SimplePubSub<Email>) {
103104 } ,
104105 ] ;
105106
106- const data = {
107+ const data : any = {
107108 inbox : { emails } ,
108109 // FIXME: we shouldn't use mapAsyncIterator here since it makes tests way more complex
109110 importantEmail : pubsub . getSubscriber ( ( newEmail ) => {
@@ -122,7 +123,7 @@ function createSubscription(pubsub: SimplePubSub<Email>) {
122123}
123124
124125async function expectPromise ( promise : Promise < unknown > ) {
125- let caughtError ;
126+ let caughtError : Error ;
126127
127128 try {
128129 await promise ;
@@ -136,7 +137,7 @@ async function expectPromise(promise: Promise<unknown>) {
136137 toReject ( ) {
137138 expect ( caughtError ) . to . be . an . instanceOf ( Error ) ;
138139 } ,
139- toRejectWith ( message ) {
140+ toRejectWith ( message : string ) {
140141 expect ( caughtError ) . to . be . an . instanceOf ( Error ) ;
141142 expect ( caughtError ) . to . have . property ( 'message' , message ) ;
142143 } ,
@@ -312,6 +313,7 @@ describe('Subscription Initialization Phase', () => {
312313 } ) ,
313314 } ) ;
314315
316+ // TODO ts-expect-error (schema must not be null)
315317 ( await expectPromise ( subscribe ( { schema : null , document } ) ) ) . toRejectWith (
316318 'Expected null to be a GraphQL schema.' ,
317319 ) ;
@@ -321,6 +323,7 @@ describe('Subscription Initialization Phase', () => {
321323 'Expected undefined to be a GraphQL schema.' ,
322324 ) ;
323325
326+ // TODO ts-expect-error (document must not be null)
324327 ( await expectPromise ( subscribe ( { schema, document : null } ) ) ) . toRejectWith (
325328 'Must provide document.' ,
326329 ) ;
0 commit comments