[jest-each] Update: templatize .each()

- Replace `any` with templates.

- Update Jest website to fix failing test.

fix #33079
This commit is contained in:
Stephen Niedzielski
2019-02-19 19:15:44 -07:00
parent fe74af5943
commit aae346fe6e
+15 -2
View File
@@ -1,5 +1,5 @@
// Type definitions for Jest 24.0
// Project: http://facebook.github.io/jest/
// Project: https://jestjs.io
// Definitions by: Asana <https://asana.com>
// Ivo Stratev <https://github.com/NoHomey>
// jwbay <https://github.com/jwbay>
@@ -263,7 +263,20 @@ declare namespace jest {
}
interface Each {
(cases: any[]): (name: string, fn: (...args: any[]) => any) => void;
// Exclusively arrays.
<T extends any[]>(cases: ReadonlyArray<T>): (
name: string,
fn: (...args: T) => any
) => void;
// Not arrays.
<T>(cases: ReadonlyArray<T>): (
name: string,
fn: (...args: T[]) => any
) => void;
(cases: ReadonlyArray<ReadonlyArray<any>>): (
name: string,
fn: (...args: any[]) => any
) => void;
(strings: TemplateStringsArray, ...placeholders: any[]): (
name: string,
fn: (arg: any) => any