Skip to content

Commit 55bb0eb

Browse files
Enable Flow on "subscribe-test.js" (#1865)
1 parent 86f2464 commit 55bb0eb

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/subscription/__tests__/subscribe-test.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @noflow
7+
* @flow strict
88
*/
99

1010
import { expect } from 'chai';
@@ -129,6 +129,7 @@ async function createSubscription(pubsub, schema = emailSchema, ast, vars) {
129129
// `subscribe` returns Promise<AsyncIterator | ExecutionResult>
130130
return {
131131
sendImportantEmail,
132+
// $FlowFixMe
132133
subscription: await subscribe(schema, ast || defaultAST, data, null, vars),
133134
};
134135
}
@@ -163,6 +164,7 @@ describe('Subscription Initialization Phase', () => {
163164
},
164165
});
165166

167+
// $FlowFixMe
166168
ai.return();
167169
});
168170

@@ -224,6 +226,7 @@ describe('Subscription Initialization Phase', () => {
224226
importantEmail: {},
225227
});
226228

229+
// $FlowFixMe
227230
await subscription.next();
228231
});
229232

@@ -257,6 +260,7 @@ describe('Subscription Initialization Phase', () => {
257260
importantEmail: {},
258261
});
259262

263+
// $FlowFixMe
260264
await subscription.next();
261265
});
262266

@@ -297,6 +301,7 @@ describe('Subscription Initialization Phase', () => {
297301
`);
298302

299303
const subscription = await subscribe(testSchema, ast);
304+
// $FlowFixMe
300305
subscription.next(); // Ask for a result, but ignore it.
301306

302307
expect(didResolveImportantEmail).to.equal(true);
@@ -314,23 +319,27 @@ describe('Subscription Initialization Phase', () => {
314319
`);
315320

316321
await expectPromiseToThrow(
322+
// $DisableFlowOnNegativeTest
317323
() => subscribe(null, document),
318324
'Expected null to be a GraphQL schema.',
319325
);
320326

321327
await expectPromiseToThrow(
328+
// $DisableFlowOnNegativeTest
322329
() => subscribe({ document }),
323330
'Expected undefined to be a GraphQL schema.',
324331
);
325332
});
326333

327334
it('throws an error if document is missing', async () => {
328335
await expectPromiseToThrow(
336+
// $DisableFlowOnNegativeTest
329337
() => subscribe(emailSchema, null),
330338
'Must provide document',
331339
);
332340

333341
await expectPromiseToThrow(
342+
// $DisableFlowOnNegativeTest
334343
() => subscribe({ schema: emailSchema }),
335344
'Must provide document',
336345
);
@@ -465,6 +474,7 @@ describe('Subscription Initialization Phase', () => {
465474
},
466475
};
467476

477+
// $FlowFixMe
468478
const result = await subscribe(emailSchema, ast, data, null, {
469479
priority: 'meow',
470480
});
@@ -831,6 +841,7 @@ describe('Subscription Publish Phase', () => {
831841
`),
832842
);
833843

844+
// $FlowFixMe
834845
const payload1 = await subscription.next();
835846
expect(payload1).to.deep.equal({
836847
done: false,
@@ -902,6 +913,7 @@ describe('Subscription Publish Phase', () => {
902913
`),
903914
);
904915

916+
// $FlowFixMe
905917
const payload1 = await subscription.next();
906918
expect(payload1).to.deep.equal({
907919
done: false,

0 commit comments

Comments
 (0)