From 2e04f77e91df28a1220d29d1a5fb2ad4d0803d2b Mon Sep 17 00:00:00 2001 From: Brian Chen Date: Sun, 14 May 2023 14:52:30 +1000 Subject: [PATCH] fix all new testing flow errors up to v11 --- .../flow_v0.104.x-v0.200.x/test_react_v11.x.x.js | 2 +- .../react_v11.x.x/flow_v0.201.x-/test_react_v11.x.x.js | 8 ++++---- .../flow_v0.104.x-v0.200.x/test_react_v12.x.x.js | 2 +- .../react_v12.x.x/flow_v0.201.x-/test_react_v12.x.x.js | 4 ++-- .../flow_v0.104.x-v0.200.x/test_react_v13.x.x.js | 2 +- .../react_v13.x.x/flow_v0.201.x-/test_react_v13.x.x.js | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/definitions/npm/@testing-library/react_v11.x.x/flow_v0.104.x-v0.200.x/test_react_v11.x.x.js b/definitions/npm/@testing-library/react_v11.x.x/flow_v0.104.x-v0.200.x/test_react_v11.x.x.js index d785817fbd..9e763b2e9d 100644 --- a/definitions/npm/@testing-library/react_v11.x.x/flow_v0.104.x-v0.200.x/test_react_v11.x.x.js +++ b/definitions/npm/@testing-library/react_v11.x.x/flow_v0.104.x-v0.200.x/test_react_v11.x.x.js @@ -36,7 +36,7 @@ describe('act', () => { }); it('should fail on incorrect usage of result', () => { - // $FlowExpectedError[incompatible-type] + // $FlowExpectedError[unsafe-addition] act(() => {}) + 1; // $FlowExpectedError[prop-missing] act(() => {}).doesNotExist(); diff --git a/definitions/npm/@testing-library/react_v11.x.x/flow_v0.201.x-/test_react_v11.x.x.js b/definitions/npm/@testing-library/react_v11.x.x/flow_v0.201.x-/test_react_v11.x.x.js index d785817fbd..5c37c6ac63 100644 --- a/definitions/npm/@testing-library/react_v11.x.x/flow_v0.201.x-/test_react_v11.x.x.js +++ b/definitions/npm/@testing-library/react_v11.x.x/flow_v0.201.x-/test_react_v11.x.x.js @@ -31,12 +31,12 @@ describe('act', () => { act(() => {}); act(() => Promise.resolve()); act(() => ({ - then: (resolve) => {}, + then: (resolve: () => mixed) => {}, })); }); it('should fail on incorrect usage of result', () => { - // $FlowExpectedError[incompatible-type] + // $FlowExpectedError[unsafe-addition] act(() => {}) + 1; // $FlowExpectedError[prop-missing] act(() => {}).doesNotExist(); @@ -78,8 +78,8 @@ describe('waitForDomChange', () => { }); it('should pass on correct inputs', () => { - waitForDomChange({ container: document.createElement('div') }); - waitForDomChange({ timeout: 1 }); + waitForDomChange({ container: document.createElement('div') }); + waitForDomChange({ timeout: 1 }); }); }); diff --git a/definitions/npm/@testing-library/react_v12.x.x/flow_v0.104.x-v0.200.x/test_react_v12.x.x.js b/definitions/npm/@testing-library/react_v12.x.x/flow_v0.104.x-v0.200.x/test_react_v12.x.x.js index 92c07e522e..9d201ae67b 100644 --- a/definitions/npm/@testing-library/react_v12.x.x/flow_v0.104.x-v0.200.x/test_react_v12.x.x.js +++ b/definitions/npm/@testing-library/react_v12.x.x/flow_v0.104.x-v0.200.x/test_react_v12.x.x.js @@ -36,7 +36,7 @@ describe('act', () => { }); it('should fail on incorrect usage of result', () => { - // $FlowExpectedError[incompatible-type] + // $FlowExpectedError[unsafe-addition] act(() => {}) + 1; // $FlowExpectedError[prop-missing] act(() => {}).doesNotExist(); diff --git a/definitions/npm/@testing-library/react_v12.x.x/flow_v0.201.x-/test_react_v12.x.x.js b/definitions/npm/@testing-library/react_v12.x.x/flow_v0.201.x-/test_react_v12.x.x.js index 92c07e522e..22a597903c 100644 --- a/definitions/npm/@testing-library/react_v12.x.x/flow_v0.201.x-/test_react_v12.x.x.js +++ b/definitions/npm/@testing-library/react_v12.x.x/flow_v0.201.x-/test_react_v12.x.x.js @@ -31,12 +31,12 @@ describe('act', () => { act(() => {}); act(() => Promise.resolve()); act(() => ({ - then: (resolve) => {}, + then: (resolve: () => mixed) => {}, })); }); it('should fail on incorrect usage of result', () => { - // $FlowExpectedError[incompatible-type] + // $FlowExpectedError[unsafe-addition] act(() => {}) + 1; // $FlowExpectedError[prop-missing] act(() => {}).doesNotExist(); diff --git a/definitions/npm/@testing-library/react_v13.x.x/flow_v0.104.x-v0.200.x/test_react_v13.x.x.js b/definitions/npm/@testing-library/react_v13.x.x/flow_v0.104.x-v0.200.x/test_react_v13.x.x.js index b55501628c..906aae6fe5 100644 --- a/definitions/npm/@testing-library/react_v13.x.x/flow_v0.104.x-v0.200.x/test_react_v13.x.x.js +++ b/definitions/npm/@testing-library/react_v13.x.x/flow_v0.104.x-v0.200.x/test_react_v13.x.x.js @@ -34,7 +34,7 @@ describe('act', () => { }); it('should fail on incorrect usage of result', () => { - // $FlowExpectedError[incompatible-type] + // $FlowExpectedError[unsafe-addition] act(() => {}) + 1; // $FlowExpectedError[prop-missing] act(() => {}).doesNotExist(); diff --git a/definitions/npm/@testing-library/react_v13.x.x/flow_v0.201.x-/test_react_v13.x.x.js b/definitions/npm/@testing-library/react_v13.x.x/flow_v0.201.x-/test_react_v13.x.x.js index b55501628c..6d468b3c8b 100644 --- a/definitions/npm/@testing-library/react_v13.x.x/flow_v0.201.x-/test_react_v13.x.x.js +++ b/definitions/npm/@testing-library/react_v13.x.x/flow_v0.201.x-/test_react_v13.x.x.js @@ -29,12 +29,12 @@ describe('act', () => { act(() => {}); act(() => Promise.resolve()); act(() => ({ - then: (resolve) => {}, + then: (resolve: () => mixed) => {}, })); }); it('should fail on incorrect usage of result', () => { - // $FlowExpectedError[incompatible-type] + // $FlowExpectedError[unsafe-addition] act(() => {}) + 1; // $FlowExpectedError[prop-missing] act(() => {}).doesNotExist();