DefinitelyTyped/types/jest-each/index.d.ts
2019-02-12 14:36:28 -08:00

43 lines
1.0 KiB
TypeScript

// Type definitions for jest-each 0.3
// Project: https://github.com/facebook/jest
// Definitions by: Michael Utz <https://github.com/theutz>, Nick McCurdy <https://github.com/nickmccurdy>
// Definitions: <https://github.com/DefinitelyTyped/DefinitelyTyped>
// TypeScript Version: 2.2
export default JestEach;
declare function JestEach(parameters: any[][]): JestEach.ReturnType;
declare namespace JestEach {
type SyncCallback = (...args: any[]) => void;
type AsyncCallback = () => void;
type TestCallback = SyncCallback | AsyncCallback;
type TestFn = (name: string, fn: TestCallback) => void;
type DescribeFn = (name: string, fn: SyncCallback) => void;
interface TestObj {
(name: string, fn: TestCallback): void;
only: TestFn;
skip: TestFn;
}
interface DescribeObj {
(name: string, fn: SyncCallback): void;
only: DescribeFn;
skip: DescribeFn;
}
interface ReturnType {
test: TestObj;
it: TestObj;
fit: TestFn;
xit: TestFn;
xtest: TestFn;
describe: DescribeObj;
fdescribe: DescribeFn;
xdescribe: DescribeFn;
}
}