From 24242eccfe7b4755da8276f818bc96fac46da6b3 Mon Sep 17 00:00:00 2001 From: William Chargin Date: Mon, 22 Oct 2018 10:05:11 -0700 Subject: [PATCH] chore: update flow-typed libdefs (#932) Summary: Generated with `flow-typed install --skip --overwrite`. Test Plan: `yarn flow` passes. wchargin-branch: flow-typed-update --- flow-typed/npm/enzyme_v3.x.x.js | 5 ++- flow-typed/npm/jest_v23.x.x.js | 59 +++++++++++++++----------- flow-typed/npm/object-assign_v4.x.x.js | 6 +-- 3 files changed, 40 insertions(+), 30 deletions(-) diff --git a/flow-typed/npm/enzyme_v3.x.x.js b/flow-typed/npm/enzyme_v3.x.x.js index abf4330..1105094 100644 --- a/flow-typed/npm/enzyme_v3.x.x.js +++ b/flow-typed/npm/enzyme_v3.x.x.js @@ -1,5 +1,5 @@ -// flow-typed signature: 7be2af8800fdadaea6ac0404d256bafc -// flow-typed version: 6ce6a0467c/enzyme_v3.x.x/flow_>=v0.53.x +// flow-typed signature: e50486ad88c5bbfcdfde9fef4fc4c5d1 +// flow-typed version: ab187b275b/enzyme_v3.x.x/flow_>=v0.53.x import * as React from "react"; @@ -53,6 +53,7 @@ declare module "enzyme" { prop(key: string): any, key(): string, simulate(event: string, ...args: Array): this, + slice(begin?: number, end?: number): this, setState(state: {}, callback?: Function): this, setProps(props: {}): this, setContext(context: Object): this, diff --git a/flow-typed/npm/jest_v23.x.x.js b/flow-typed/npm/jest_v23.x.x.js index 9e0fec1..95835f5 100644 --- a/flow-typed/npm/jest_v23.x.x.js +++ b/flow-typed/npm/jest_v23.x.x.js @@ -1,5 +1,5 @@ -// flow-typed signature: f9a2c9a8964707fcb0c42a8e48c82e8d -// flow-typed version: b2855bf71a/jest_v23.x.x/flow_>=v0.39.x +// flow-typed signature: 78c200acffbcc16bba9478f5396c3a00 +// flow-typed version: b2980740dd/jest_v23.x.x/flow_>=v0.39.x type JestMockFn, TReturn> = { (...args: TArguments): TReturn, @@ -199,16 +199,28 @@ type EnzymeMatchersType = { toIncludeText(text: string): void, toMatchElement( element: React$Element, - options?: {| ignoreProps?: boolean |}, + options?: {| ignoreProps?: boolean, verbose?: boolean |}, ): void, - toMatchSelector(selector: string): void + toMatchSelector(selector: string): void, + // 7.x + toHaveDisplayName(name: string): void, }; // DOM testing library extensions https://github.com/kentcdodds/dom-testing-library#custom-jest-matchers type DomTestingLibraryType = { + toBeDisabled(): void, + toBeEmpty(): void, + toBeInTheDocument(): void, + toBeVisible(): void, + toContainElement(element: HTMLElement | null): void, + toContainHTML(htmlText: string): void, + toHaveAttribute(name: string, expectedValue?: string): void, + toHaveClass(...classNames: string[]): void, + toHaveFocus(): void, + toHaveFormValues(expectedValues: { [name: string]: any }): void, + toHaveStyle(css: string): void, + toHaveTextContent(content: string | RegExp, options?: { normalizeWhitespace: boolean }): void, toBeInTheDOM(): void, - toHaveTextContent(content: string): void, - toHaveAttribute(name: string, expectedValue?: string): void }; // Jest JQuery Matchers: https://github.com/unindented/custom-jquery-matchers @@ -704,14 +716,14 @@ interface JestExpectType { /** * This ensures that an Object matches the most recent snapshot. */ - toMatchSnapshot(propertyMatchers?: {[key: string]: JestAsymmetricEqualityType}, name?: string): void, + toMatchSnapshot(propertyMatchers?: any, name?: string): void, /** * This ensures that an Object matches the most recent snapshot. */ toMatchSnapshot(name: string): void, toMatchInlineSnapshot(snapshot?: string): void, - toMatchInlineSnapshot(propertyMatchers?: {[key: string]: JestAsymmetricEqualityType}, snapshot?: string): void, + toMatchInlineSnapshot(propertyMatchers?: any, snapshot?: string): void, /** * Use .toThrow to test that a function throws when it is called. * If you want to test that a specific error gets thrown, you can provide an @@ -937,10 +949,11 @@ declare var describe: { * @param {table} table of Test */ each( - table: Array | mixed> + ...table: Array | mixed> | [Array, string] ): ( name: JestTestName, - fn?: (...args: Array) => ?Promise + fn?: (...args: Array) => ?Promise, + timeout?: number ) => void, }; @@ -958,17 +971,7 @@ declare var it: { fn?: (done: () => void) => ?Promise, timeout?: number ): void, - /** - * each runs this test against array of argument arrays per each run - * - * @param {table} table of Test - */ - each( - table: Array | mixed> - ): ( - name: JestTestName, - fn?: (...args: Array) => ?Promise - ) => void, + /** * Only run this test * @@ -982,12 +985,14 @@ declare var it: { timeout?: number ): { each( - table: Array | mixed> + ...table: Array | mixed> | [Array, string] ): ( name: JestTestName, - fn?: (...args: Array) => ?Promise + fn?: (...args: Array) => ?Promise, + timeout?: number ) => void, }, + /** * Skip running this test * @@ -1000,6 +1005,7 @@ declare var it: { fn?: (done: () => void) => ?Promise, timeout?: number ): void, + /** * Run the test concurrently * @@ -1012,18 +1018,21 @@ declare var it: { fn?: (done: () => void) => ?Promise, timeout?: number ): void, + /** * each runs this test against array of argument arrays per each run * * @param {table} table of Test */ each( - table: Array | mixed> + ...table: Array | mixed> | [Array, string] ): ( name: JestTestName, - fn?: (...args: Array) => ?Promise + fn?: (...args: Array) => ?Promise, + timeout?: number ) => void, }; + declare function fit( name: JestTestName, fn: (done: () => void) => ?Promise, diff --git a/flow-typed/npm/object-assign_v4.x.x.js b/flow-typed/npm/object-assign_v4.x.x.js index 612e2b9..9ef2250 100644 --- a/flow-typed/npm/object-assign_v4.x.x.js +++ b/flow-typed/npm/object-assign_v4.x.x.js @@ -1,6 +1,6 @@ -// flow-typed signature: 6b26bd45f602f11945a41846caafb9a1 -// flow-typed version: da30fe6876/object-assign_v4.x.x/flow_>=v0.25.x +// flow-typed signature: 0163683fe464be718f5e440cbb72d8b0 +// flow-typed version: 62c71f6105/object-assign_v4.x.x/flow_>=v0.25.x declare module "object-assign" { - declare module.exports: (target: any, ...sources: Array) => Object; + declare module.exports: Object$Assign; }