From 55bb0ebe811929ed8227f09fc813ffb196e35ddb Mon Sep 17 00:00:00 2001 From: Ivan Goncharov Date: Sat, 18 May 2019 19:11:48 +0300 Subject: [PATCH] Enable Flow on "subscribe-test.js" (#1865) --- src/subscription/__tests__/subscribe-test.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/subscription/__tests__/subscribe-test.js b/src/subscription/__tests__/subscribe-test.js index 53c0f47481..1dc04586ed 100644 --- a/src/subscription/__tests__/subscribe-test.js +++ b/src/subscription/__tests__/subscribe-test.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @noflow + * @flow strict */ import { expect } from 'chai'; @@ -129,6 +129,7 @@ async function createSubscription(pubsub, schema = emailSchema, ast, vars) { // `subscribe` returns Promise return { sendImportantEmail, + // $FlowFixMe subscription: await subscribe(schema, ast || defaultAST, data, null, vars), }; } @@ -163,6 +164,7 @@ describe('Subscription Initialization Phase', () => { }, }); + // $FlowFixMe ai.return(); }); @@ -224,6 +226,7 @@ describe('Subscription Initialization Phase', () => { importantEmail: {}, }); + // $FlowFixMe await subscription.next(); }); @@ -257,6 +260,7 @@ describe('Subscription Initialization Phase', () => { importantEmail: {}, }); + // $FlowFixMe await subscription.next(); }); @@ -297,6 +301,7 @@ describe('Subscription Initialization Phase', () => { `); const subscription = await subscribe(testSchema, ast); + // $FlowFixMe subscription.next(); // Ask for a result, but ignore it. expect(didResolveImportantEmail).to.equal(true); @@ -314,11 +319,13 @@ describe('Subscription Initialization Phase', () => { `); await expectPromiseToThrow( + // $DisableFlowOnNegativeTest () => subscribe(null, document), 'Expected null to be a GraphQL schema.', ); await expectPromiseToThrow( + // $DisableFlowOnNegativeTest () => subscribe({ document }), 'Expected undefined to be a GraphQL schema.', ); @@ -326,11 +333,13 @@ describe('Subscription Initialization Phase', () => { it('throws an error if document is missing', async () => { await expectPromiseToThrow( + // $DisableFlowOnNegativeTest () => subscribe(emailSchema, null), 'Must provide document', ); await expectPromiseToThrow( + // $DisableFlowOnNegativeTest () => subscribe({ schema: emailSchema }), 'Must provide document', ); @@ -465,6 +474,7 @@ describe('Subscription Initialization Phase', () => { }, }; + // $FlowFixMe const result = await subscribe(emailSchema, ast, data, null, { priority: 'meow', }); @@ -831,6 +841,7 @@ describe('Subscription Publish Phase', () => { `), ); + // $FlowFixMe const payload1 = await subscription.next(); expect(payload1).to.deep.equal({ done: false, @@ -902,6 +913,7 @@ describe('Subscription Publish Phase', () => { `), ); + // $FlowFixMe const payload1 = await subscription.next(); expect(payload1).to.deep.equal({ done: false,