From c13e5d0b43454586e92bd33df65b7e223c745fc3 Mon Sep 17 00:00:00 2001 From: Jan Kassens Date: Thu, 18 Jul 2019 09:34:11 -0700 Subject: [PATCH] fix jest's test.table flow type Summary: The current flow type disallows passing in an `Array` since the current type signature would allow just to append to the `Array`, `$ReadOnlyArray` doesn't allow writing. @public Reviewed By: jstejada Differential Revision: D16354977 fbshipit-source-id: a83c1227c1a15225487ac8672818d8b319dce32f --- flow/jest.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/flow/jest.js b/flow/jest.js index b149195e076..1780dfa9f28 100644 --- a/flow/jest.js +++ b/flow/jest.js @@ -953,7 +953,7 @@ declare var describe: { * @param {table} table of Test */ each( - table: Array | mixed>, + table: $ReadOnlyArray>, ): ( name: JestTestName, fn?: (...args: Array) => ?Promise, @@ -980,7 +980,7 @@ declare var it: { * @param {table} table of Test */ each( - table: Array | mixed>, + table: $ReadOnlyArray>, ): ( name: JestTestName, fn?: (...args: Array) => ?Promise, @@ -998,7 +998,7 @@ declare var it: { timeout?: number, ): { each( - table: Array | mixed>, + table: $ReadOnlyArray>, ): ( name: JestTestName, fn?: (...args: Array) => ?Promise, @@ -1034,7 +1034,7 @@ declare var it: { * @param {table} table of Test */ each( - table: Array | mixed>, + table: $ReadOnlyArray>, ): ( name: JestTestName, fn?: (...args: Array) => ?Promise, @@ -1065,9 +1065,7 @@ type JestPrettyFormatColors = { }; type JestPrettyFormatIndent = string => string; -type JestPrettyFormatRefs = Array; type JestPrettyFormatPrint = any => string; -type JestPrettyFormatStringOrNull = string | null; type JestPrettyFormatOptions = {| callToJSON: boolean,