4
4
* This source code is licensed under the MIT license found in the
5
5
* LICENSE file in the root directory of this source tree.
6
6
*
7
- * @noflow
7
+ * @flow strict
8
8
*/
9
9
10
10
import { expect } from 'chai' ;
@@ -129,6 +129,7 @@ async function createSubscription(pubsub, schema = emailSchema, ast, vars) {
129
129
// `subscribe` returns Promise<AsyncIterator | ExecutionResult>
130
130
return {
131
131
sendImportantEmail,
132
+ // $FlowFixMe
132
133
subscription : await subscribe ( schema , ast || defaultAST , data , null , vars ) ,
133
134
} ;
134
135
}
@@ -163,6 +164,7 @@ describe('Subscription Initialization Phase', () => {
163
164
} ,
164
165
} ) ;
165
166
167
+ // $FlowFixMe
166
168
ai . return ( ) ;
167
169
} ) ;
168
170
@@ -224,6 +226,7 @@ describe('Subscription Initialization Phase', () => {
224
226
importantEmail : { } ,
225
227
} ) ;
226
228
229
+ // $FlowFixMe
227
230
await subscription . next ( ) ;
228
231
} ) ;
229
232
@@ -257,6 +260,7 @@ describe('Subscription Initialization Phase', () => {
257
260
importantEmail : { } ,
258
261
} ) ;
259
262
263
+ // $FlowFixMe
260
264
await subscription . next ( ) ;
261
265
} ) ;
262
266
@@ -297,6 +301,7 @@ describe('Subscription Initialization Phase', () => {
297
301
` ) ;
298
302
299
303
const subscription = await subscribe ( testSchema , ast ) ;
304
+ // $FlowFixMe
300
305
subscription . next ( ) ; // Ask for a result, but ignore it.
301
306
302
307
expect ( didResolveImportantEmail ) . to . equal ( true ) ;
@@ -314,23 +319,27 @@ describe('Subscription Initialization Phase', () => {
314
319
` ) ;
315
320
316
321
await expectPromiseToThrow (
322
+ // $DisableFlowOnNegativeTest
317
323
( ) => subscribe ( null , document ) ,
318
324
'Expected null to be a GraphQL schema.' ,
319
325
) ;
320
326
321
327
await expectPromiseToThrow (
328
+ // $DisableFlowOnNegativeTest
322
329
( ) => subscribe ( { document } ) ,
323
330
'Expected undefined to be a GraphQL schema.' ,
324
331
) ;
325
332
} ) ;
326
333
327
334
it ( 'throws an error if document is missing' , async ( ) => {
328
335
await expectPromiseToThrow (
336
+ // $DisableFlowOnNegativeTest
329
337
( ) => subscribe ( emailSchema , null ) ,
330
338
'Must provide document' ,
331
339
) ;
332
340
333
341
await expectPromiseToThrow (
342
+ // $DisableFlowOnNegativeTest
334
343
( ) => subscribe ( { schema : emailSchema } ) ,
335
344
'Must provide document' ,
336
345
) ;
@@ -465,6 +474,7 @@ describe('Subscription Initialization Phase', () => {
465
474
} ,
466
475
} ;
467
476
477
+ // $FlowFixMe
468
478
const result = await subscribe ( emailSchema , ast , data , null , {
469
479
priority : 'meow' ,
470
480
} ) ;
@@ -831,6 +841,7 @@ describe('Subscription Publish Phase', () => {
831
841
` ) ,
832
842
) ;
833
843
844
+ // $FlowFixMe
834
845
const payload1 = await subscription . next ( ) ;
835
846
expect ( payload1 ) . to . deep . equal ( {
836
847
done : false ,
@@ -902,6 +913,7 @@ describe('Subscription Publish Phase', () => {
902
913
` ) ,
903
914
) ;
904
915
916
+ // $FlowFixMe
905
917
const payload1 = await subscription . next ( ) ;
906
918
expect ( payload1 ) . to . deep . equal ( {
907
919
done : false ,
0 commit comments