-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
2,286 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["react-native"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// flow-typed signature: 476cdf041c12e4372121dd0d59078192 | ||
// flow-typed version: <<STUB>>/babel-jest_v21.2.0/flow_v0.56.0 | ||
|
||
/** | ||
* This is an autogenerated libdef stub for: | ||
* | ||
* 'babel-jest' | ||
* | ||
* Fill this stub out by replacing all the `any` types. | ||
* | ||
* Once filled out, we encourage you to share your work with the | ||
* community by sending a pull request to: | ||
* https://github.com/flowtype/flow-typed | ||
*/ | ||
|
||
declare module 'babel-jest' { | ||
declare module.exports: any; | ||
} | ||
|
||
/** | ||
* We include stubs for each file inside this npm package in case you need to | ||
* require those files directly. Feel free to delete any files that aren't | ||
* needed. | ||
*/ | ||
declare module 'babel-jest/build/index' { | ||
declare module.exports: any; | ||
} | ||
|
||
// Filename aliases | ||
declare module 'babel-jest/build/index.js' { | ||
declare module.exports: $Exports<'babel-jest/build/index'>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// flow-typed signature: 0a6f0b938b4ca850cbfe51d2630f769c | ||
// flow-typed version: <<STUB>>/babel-preset-react-native_v4.0.0/flow_v0.56.0 | ||
|
||
/** | ||
* This is an autogenerated libdef stub for: | ||
* | ||
* 'babel-preset-react-native' | ||
* | ||
* Fill this stub out by replacing all the `any` types. | ||
* | ||
* Once filled out, we encourage you to share your work with the | ||
* community by sending a pull request to: | ||
* https://github.com/flowtype/flow-typed | ||
*/ | ||
|
||
declare module 'babel-preset-react-native' { | ||
declare module.exports: any; | ||
} | ||
|
||
/** | ||
* We include stubs for each file inside this npm package in case you need to | ||
* require those files directly. Feel free to delete any files that aren't | ||
* needed. | ||
*/ | ||
declare module 'babel-preset-react-native/configs/hmr' { | ||
declare module.exports: any; | ||
} | ||
|
||
declare module 'babel-preset-react-native/configs/main' { | ||
declare module.exports: any; | ||
} | ||
|
||
declare module 'babel-preset-react-native/lib/resolvePlugins' { | ||
declare module.exports: any; | ||
} | ||
|
||
declare module 'babel-preset-react-native/plugins' { | ||
declare module.exports: any; | ||
} | ||
|
||
declare module 'babel-preset-react-native/transforms/transform-dynamic-import' { | ||
declare module.exports: any; | ||
} | ||
|
||
declare module 'babel-preset-react-native/transforms/transform-symbol-member' { | ||
declare module.exports: any; | ||
} | ||
|
||
// Filename aliases | ||
declare module 'babel-preset-react-native/configs/hmr.js' { | ||
declare module.exports: $Exports<'babel-preset-react-native/configs/hmr'>; | ||
} | ||
declare module 'babel-preset-react-native/configs/main.js' { | ||
declare module.exports: $Exports<'babel-preset-react-native/configs/main'>; | ||
} | ||
declare module 'babel-preset-react-native/index' { | ||
declare module.exports: $Exports<'babel-preset-react-native'>; | ||
} | ||
declare module 'babel-preset-react-native/index.js' { | ||
declare module.exports: $Exports<'babel-preset-react-native'>; | ||
} | ||
declare module 'babel-preset-react-native/lib/resolvePlugins.js' { | ||
declare module.exports: $Exports<'babel-preset-react-native/lib/resolvePlugins'>; | ||
} | ||
declare module 'babel-preset-react-native/plugins.js' { | ||
declare module.exports: $Exports<'babel-preset-react-native/plugins'>; | ||
} | ||
declare module 'babel-preset-react-native/transforms/transform-dynamic-import.js' { | ||
declare module.exports: $Exports<'babel-preset-react-native/transforms/transform-dynamic-import'>; | ||
} | ||
declare module 'babel-preset-react-native/transforms/transform-symbol-member.js' { | ||
declare module.exports: $Exports<'babel-preset-react-native/transforms/transform-symbol-member'>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
// flow-typed signature: 687805dabf4b11b8ad99d263c9d3703d | ||
// flow-typed version: f0c7fe5246/enzyme_v3.x.x/flow_>=v0.53.x | ||
|
||
import * as React from "react"; | ||
|
||
declare module "enzyme" { | ||
declare type PredicateFunction<T: Wrapper> = ( | ||
wrapper: T, | ||
index: number | ||
) => boolean; | ||
declare type NodeOrNodes = React.Node | Array<React.Node>; | ||
declare type EnzymeSelector = string | Class<React.Component<*, *>> | Object; | ||
|
||
// CheerioWrapper is a type alias for an actual cheerio instance | ||
// TODO: Reference correct type from cheerio's type declarations | ||
declare type CheerioWrapper = any; | ||
|
||
declare class Wrapper { | ||
find(selector: EnzymeSelector): this, | ||
findWhere(predicate: PredicateFunction<this>): this, | ||
filter(selector: EnzymeSelector): this, | ||
filterWhere(predicate: PredicateFunction<this>): this, | ||
contains(nodeOrNodes: NodeOrNodes): boolean, | ||
containsMatchingElement(node: React.Node): boolean, | ||
containsAllMatchingElements(nodes: NodeOrNodes): boolean, | ||
containsAnyMatchingElements(nodes: NodeOrNodes): boolean, | ||
dive(option?: { context?: Object }): this, | ||
exists(): boolean, | ||
isEmptyRender(): boolean, | ||
matchesElement(node: React.Node): boolean, | ||
hasClass(className: string): boolean, | ||
is(selector: EnzymeSelector): boolean, | ||
isEmpty(): boolean, | ||
not(selector: EnzymeSelector): this, | ||
children(selector?: EnzymeSelector): this, | ||
childAt(index: number): this, | ||
parents(selector?: EnzymeSelector): this, | ||
parent(): this, | ||
closest(selector: EnzymeSelector): this, | ||
render(): CheerioWrapper, | ||
unmount(): this, | ||
text(): string, | ||
html(): string, | ||
get(index: number): React.Node, | ||
getNodes(): Array<React.Node>, | ||
getDOMNode(): HTMLElement | HTMLInputElement, | ||
at(index: number): this, | ||
first(): this, | ||
last(): this, | ||
state(key?: string): any, | ||
context(key?: string): any, | ||
props(): Object, | ||
prop(key: string): any, | ||
key(): string, | ||
simulate(event: string, ...args: Array<any>): this, | ||
setState(state: {}, callback?: Function): this, | ||
setProps(props: {}): this, | ||
setContext(context: Object): this, | ||
instance(): React.Component<*, *>, | ||
update(): this, | ||
debug(): string, | ||
type(): string | Function | null, | ||
name(): string, | ||
forEach(fn: (node: this, index: number) => mixed): this, | ||
map<T>(fn: (node: this, index: number) => T): Array<T>, | ||
reduce<T>( | ||
fn: (value: T, node: this, index: number) => T, | ||
initialValue?: T | ||
): Array<T>, | ||
reduceRight<T>( | ||
fn: (value: T, node: this, index: number) => T, | ||
initialValue?: T | ||
): Array<T>, | ||
some(selector: EnzymeSelector): boolean, | ||
someWhere(predicate: PredicateFunction<this>): boolean, | ||
every(selector: EnzymeSelector): boolean, | ||
everyWhere(predicate: PredicateFunction<this>): boolean, | ||
length: number | ||
} | ||
|
||
declare class ReactWrapper extends Wrapper { | ||
constructor(nodes: NodeOrNodes, root: any, options?: ?Object): ReactWrapper, | ||
mount(): this, | ||
ref(refName: string): this, | ||
detach(): void | ||
} | ||
|
||
declare class ShallowWrapper extends Wrapper { | ||
constructor( | ||
nodes: NodeOrNodes, | ||
root: any, | ||
options?: ?Object | ||
): ShallowWrapper, | ||
equals(node: React.Node): boolean, | ||
shallow(options?: { context?: Object }): ShallowWrapper | ||
} | ||
|
||
declare function shallow( | ||
node: React.Node, | ||
options?: { context?: Object, disableLifecycleMethods?: boolean } | ||
): ShallowWrapper; | ||
declare function mount( | ||
node: React.Node, | ||
options?: { | ||
context?: Object, | ||
attachTo?: HTMLElement, | ||
childContextTypes?: Object | ||
} | ||
): ReactWrapper; | ||
declare function render( | ||
node: React.Node, | ||
options?: { context?: Object } | ||
): CheerioWrapper; | ||
|
||
declare module.exports: { | ||
configure(options: { | ||
Adapter?: any, | ||
disableLifecycleMethods?: boolean | ||
}): void, | ||
render: typeof render, | ||
mount: typeof mount, | ||
shallow: typeof shallow, | ||
ShallowWrapper: typeof ShallowWrapper, | ||
ReactWrapper: typeof ReactWrapper | ||
}; | ||
} |
Oops, something went wrong.