UNPKG

2.8 kBTypeScriptView Raw
1/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7import type {Global} from '@jest/types';
8
9export declare function bind<EachCallback extends Global.TestCallback>(
10 cb: GlobalCallback,
11 supportsDone?: boolean,
12 needsEachError?: boolean,
13): Global.EachTestFn<any>;
14
15declare const each: {
16 (table: Global.EachTable, ...data: Global.TemplateData): ReturnType<
17 typeof install
18 >;
19 withGlobal(g: Global): (
20 table: Global.EachTable,
21 ...data: Global.TemplateData
22 ) => {
23 describe: {
24 (
25 title: string,
26 suite: Global.EachTestFn<Global.BlockFn>,
27 timeout?: number,
28 ): any;
29 skip: any;
30 only: any;
31 };
32 fdescribe: any;
33 fit: any;
34 it: {
35 (
36 title: string,
37 test: Global.EachTestFn<Global.TestFn>,
38 timeout?: number,
39 ): any;
40 skip: any;
41 only: any;
42 concurrent: {
43 (
44 title: string,
45 test: Global.EachTestFn<Global.TestFn>,
46 timeout?: number,
47 ): any;
48 only: any;
49 skip: any;
50 };
51 };
52 test: {
53 (
54 title: string,
55 test: Global.EachTestFn<Global.TestFn>,
56 timeout?: number,
57 ): any;
58 skip: any;
59 only: any;
60 concurrent: {
61 (
62 title: string,
63 test: Global.EachTestFn<Global.TestFn>,
64 timeout?: number,
65 ): any;
66 only: any;
67 skip: any;
68 };
69 };
70 xdescribe: any;
71 xit: any;
72 xtest: any;
73 };
74};
75export default each;
76
77declare type GlobalCallback = (
78 testName: string,
79 fn: Global.ConcurrentTestFn,
80 timeout?: number,
81 eachError?: Error,
82) => void;
83
84declare const install: (
85 g: Global,
86 table: Global.EachTable,
87 ...data: Global.TemplateData
88) => {
89 describe: {
90 (
91 title: string,
92 suite: Global.EachTestFn<Global.BlockFn>,
93 timeout?: number,
94 ): any;
95 skip: any;
96 only: any;
97 };
98 fdescribe: any;
99 fit: any;
100 it: {
101 (
102 title: string,
103 test: Global.EachTestFn<Global.TestFn>,
104 timeout?: number,
105 ): any;
106 skip: any;
107 only: any;
108 concurrent: {
109 (
110 title: string,
111 test: Global.EachTestFn<Global.TestFn>,
112 timeout?: number,
113 ): any;
114 only: any;
115 skip: any;
116 };
117 };
118 test: {
119 (
120 title: string,
121 test: Global.EachTestFn<Global.TestFn>,
122 timeout?: number,
123 ): any;
124 skip: any;
125 only: any;
126 concurrent: {
127 (
128 title: string,
129 test: Global.EachTestFn<Global.TestFn>,
130 timeout?: number,
131 ): any;
132 only: any;
133 skip: any;
134 };
135 };
136 xdescribe: any;
137 xit: any;
138 xtest: any;
139};
140
141export {};