@types/enzyme
Advanced tools
Comparing version 3.1.0 to 3.1.1
@@ -51,3 +51,2 @@ // Type definitions for Enzyme 3.1 | ||
* Returns a new wrapper with only the nodes of the current wrapper that, when passed into the provided predicate function, return true. | ||
* @param predicate | ||
*/ | ||
@@ -58,3 +57,2 @@ filterWhere(predicate: (wrapper: this) => boolean): this; | ||
* Returns whether or not the current wrapper has a node anywhere in it's render tree that looks like the one passed in. | ||
* @param node | ||
*/ | ||
@@ -65,3 +63,2 @@ contains(node: ReactElement<any> | string): boolean; | ||
* Returns whether or not a given react element exists in the shallow render tree. | ||
* @param node | ||
*/ | ||
@@ -72,3 +69,2 @@ containsMatchingElement(node: ReactElement<any>): boolean; | ||
* Returns whether or not all the given react elements exists in the shallow render tree | ||
* @param nodes | ||
*/ | ||
@@ -79,3 +75,2 @@ containsAllMatchingElements(nodes: Array<ReactElement<any>>): boolean; | ||
* Returns whether or not one of the given react elements exists in the shallow render tree. | ||
* @param nodes | ||
*/ | ||
@@ -96,3 +91,2 @@ containsAnyMatchingElements(nodes: Array<ReactElement<any>>): boolean; | ||
* Returns whether or not the current node has a className prop including the passed in class name. | ||
* @param className | ||
*/ | ||
@@ -103,3 +97,2 @@ hasClass(className: string): boolean; | ||
* Returns whether or not the current node matches a provided selector. | ||
* @param selector | ||
*/ | ||
@@ -122,3 +115,2 @@ is(selector: EnzymeSelector): boolean; | ||
* This method is effectively the negation or inverse of filter. | ||
* @param selector | ||
*/ | ||
@@ -145,3 +137,2 @@ not(selector: EnzymeSelector): this; | ||
* Returns the node at a given index of the current wrapper. | ||
* @param index | ||
*/ | ||
@@ -177,3 +168,2 @@ get(index: number): ReactElement<any>; | ||
* Returns a wrapper around the node at a given index of the current wrapper. | ||
* @param index | ||
*/ | ||
@@ -204,3 +194,2 @@ at(index: number): this; | ||
* Returns the state hash for the root node of the wrapper. Optionally pass in a prop name and it will return just that value. | ||
* @param [key] | ||
*/ | ||
@@ -228,3 +217,2 @@ state(): S; | ||
* NOTE: can only be called on a wrapper of a single node. | ||
* @param key | ||
*/ | ||
@@ -243,3 +231,2 @@ prop<K extends keyof P>(key: K): P[K]; | ||
* Returns itself. | ||
* @param event | ||
* @param args? | ||
@@ -258,4 +245,2 @@ */ | ||
* NOTE: can only be called on a wrapper instance that is also the root instance. | ||
* @param state | ||
* @param [callback] | ||
*/ | ||
@@ -273,3 +258,2 @@ setState<K extends keyof S>(state: Pick<S, K>, callback?: () => void): this; | ||
* NOTE: can only be called on a wrapper instance that is also the root instance. | ||
* @param props | ||
*/ | ||
@@ -284,3 +268,2 @@ setProps<K extends keyof P>(props: Pick<P, K>): this; | ||
* NOTE: can only be called on a wrapper instance that is also the root instance. | ||
* @param state | ||
*/ | ||
@@ -339,4 +322,2 @@ setContext(context: any): this; | ||
* is passed in as a ShallowWrapper, and is processed from left to right. | ||
* @param fn | ||
* @param initialValue | ||
*/ | ||
@@ -348,4 +329,2 @@ reduce<R>(fn: (prevVal: R, wrapper: this, index: number) => R, initialValue?: R): R; | ||
* Each node is passed in as a ShallowWrapper, and is processed from right to left. | ||
* @param fn | ||
* @param initialValue | ||
*/ | ||
@@ -356,3 +335,2 @@ reduceRight<R>(fn: (prevVal: R, wrapper: this, index: number) => R, initialValue?: R): R; | ||
* Returns whether or not any of the nodes in the wrapper match the provided selector. | ||
* @param selector | ||
*/ | ||
@@ -363,3 +341,2 @@ some(selector: EnzymeSelector): boolean; | ||
* Returns whether or not any of the nodes in the wrapper pass the provided predicate function. | ||
* @param fn | ||
*/ | ||
@@ -370,3 +347,2 @@ someWhere(fn: (wrapper: this) => boolean): boolean; | ||
* Returns whether or not all of the nodes in the wrapper match the provided selector. | ||
* @param selector | ||
*/ | ||
@@ -377,3 +353,2 @@ every(selector: EnzymeSelector): boolean; | ||
* Returns whether or not all of the nodes in the wrapper pass the provided predicate function. | ||
* @param fn | ||
*/ | ||
@@ -403,7 +378,5 @@ everyWhere(fn: (wrapper: this) => boolean): boolean; | ||
export class ShallowWrapper { | ||
export interface ShallowWrapper<P = {}, S = {}> extends CommonWrapper<P, S> {} | ||
export class ShallowWrapper<P = {}, S = {}> { | ||
constructor(nodes: JSX.Element[] | JSX.Element, root?: ShallowWrapper, options?: ShallowRendererProps); | ||
} | ||
export interface ShallowWrapper<P = {}, S = {}> extends CommonWrapper<P, S> { | ||
shallow(options?: ShallowRendererProps): ShallowWrapper<P, S>; | ||
@@ -430,3 +403,2 @@ unmount(): this; | ||
* Finds every node in the render tree that returns true for the provided predicate function. | ||
* @param predicate | ||
*/ | ||
@@ -438,3 +410,2 @@ findWhere(predicate: (wrapper: ShallowWrapper<any, any>) => boolean): ShallowWrapper<any, any>; | ||
* can be provided and it will filter the children by this selector. | ||
* @param [selector] | ||
*/ | ||
@@ -448,3 +419,2 @@ children<P2>(component: ComponentClass<P2>): ShallowWrapper<P2, any>; | ||
* Returns a new wrapper with child at the specified index. | ||
* @param index | ||
*/ | ||
@@ -457,3 +427,2 @@ childAt(index: number): ShallowWrapper<any, any>; | ||
* NOTE: can only be called on wrapper of a single non-DOM component element node. | ||
* @param [options] | ||
*/ | ||
@@ -475,3 +444,2 @@ dive<P2, S2>(options?: ShallowRendererProps): ShallowWrapper<P2, S2>; | ||
* Note: can only be called on a wrapper of a single node. | ||
* @param [selector] | ||
*/ | ||
@@ -488,3 +456,2 @@ parents<P2>(component: ComponentClass<P2>): ShallowWrapper<P2, any>; | ||
* Note: can only be called on a wrapper of a single node. | ||
* @param selector | ||
*/ | ||
@@ -502,7 +469,6 @@ closest<P2>(component: ComponentClass<P2>): ShallowWrapper<P2, any>; | ||
export class ReactWrapper { | ||
export interface ReactWrapper<P = {}, S = {}> extends CommonWrapper<P, S> {} | ||
export class ReactWrapper<P = {}, S = {}> { | ||
constructor(nodes: JSX.Element | JSX.Element[], root?: ReactWrapper, options?: MountRendererProps); | ||
} | ||
export interface ReactWrapper<P = {}, S = {}> extends CommonWrapper<P, S> { | ||
unmount(): this; | ||
@@ -550,3 +516,2 @@ mount(): this; | ||
* Finds every node in the render tree that returns true for the provided predicate function. | ||
* @param predicate | ||
*/ | ||
@@ -565,3 +530,2 @@ findWhere(predicate: (wrapper: ReactWrapper<any, any>) => boolean): ReactWrapper<any, any>; | ||
* can be provided and it will filter the children by this selector. | ||
* @param [selector] | ||
*/ | ||
@@ -575,3 +539,2 @@ children<P2>(component: ComponentClass<P2>): ReactWrapper<P2, any>; | ||
* Returns a new wrapper with child at the specified index. | ||
* @param index | ||
*/ | ||
@@ -586,3 +549,2 @@ childAt(index: number): ReactWrapper<any, any>; | ||
* Note: can only be called on a wrapper of a single node. | ||
* @param [selector] | ||
*/ | ||
@@ -599,3 +561,2 @@ parents<P2>(component: ComponentClass<P2>): ReactWrapper<P2, any>; | ||
* Note: can only be called on a wrapper of a single node. | ||
* @param selector | ||
*/ | ||
@@ -621,4 +582,2 @@ closest<P2>(component: ComponentClass<P2>): ReactWrapper<P2, any>; | ||
* NOTE: can only be called on a wrapper instance that is also the root instance. | ||
* @param props | ||
* @param [callback] | ||
*/ | ||
@@ -657,4 +616,2 @@ setProps<K extends keyof P>(props: Pick<P, K>, callback?: () => void): this; | ||
* your tests aren't indirectly asserting on behavior of child components. | ||
* @param node | ||
* @param [options] | ||
*/ | ||
@@ -666,4 +623,2 @@ export function shallow<P>(node: ReactElement<P>, options?: ShallowRendererProps): ShallowWrapper<P, any>; | ||
* Mounts and renders a react component into the document and provides a testing wrapper around it. | ||
* @param node | ||
* @param [options] | ||
*/ | ||
@@ -675,4 +630,2 @@ export function mount<P>(node: ReactElement<P>, options?: MountRendererProps): ReactWrapper<P, any>; | ||
* Render react components to static HTML and analyze the resulting HTML structure. | ||
* @param node | ||
* @param [options] | ||
*/ | ||
@@ -688,4 +641,3 @@ export function render<P, S>(node: ReactElement<P>, options?: any): Cheerio; | ||
* This is enabling the Enzyme configuration with adapters in TS | ||
* @param options | ||
*/ | ||
export function configure(options: { adapter: EnzymeAdapter }): void; |
{ | ||
"name": "@types/enzyme", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"description": "TypeScript definitions for Enzyme", | ||
@@ -52,4 +52,4 @@ "license": "MIT", | ||
}, | ||
"typesPublisherContentHash": "0e5235d0644b49c91a24e2f236d0ddcce4ce869ab5053cb570052edc89feaf37", | ||
"typesPublisherContentHash": "b4ff779522ca277a65f5050368f202d0c4b06a637a5b3be44f5bbaf86e697401", | ||
"typeScriptVersion": "2.3" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
Additional Details | ||
* Last updated: Sat, 14 Oct 2017 06:12:37 GMT | ||
* Last updated: Wed, 25 Oct 2017 00:19:45 GMT | ||
* Dependencies: react, cheerio | ||
@@ -14,0 +14,0 @@ * Global values: none |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26569
514