Merge pull request #33216 from niedzielski/update/jest-each-templatize

[jest-each] Update: templatize .each()
This commit is contained in:
Gabriela Britto
2019-03-08 10:10:37 -08:00
committed by GitHub
+18 -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>
@@ -264,7 +264,23 @@ declare namespace jest {
}
interface Each {
(cases: any[]): (name: string, fn: (...args: any[]) => any, timeout?: number) => void;
// Exclusively arrays.
<T extends any[]>(cases: ReadonlyArray<T>): (
name: string,
fn: (...args: T) => any,
timeout?: number
) => void;
// Not arrays.
<T>(cases: ReadonlyArray<T>): (
name: string,
fn: (...args: T[]) => any,
timeout?: number
) => void;
(cases: ReadonlyArray<ReadonlyArray<any>>): (
name: string,
fn: (...args: any[]) => any,
timeout?: number
) => void;
(strings: TemplateStringsArray, ...placeholders: any[]): (
name: string,
fn: (arg: any) => any,