Skip to content

Commit

Permalink
[cavy] Infer props from native components
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Dec 8, 2021
1 parent d0f223a commit 9760dea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions types/cavy/cavy-tests.tsx
Expand Up @@ -48,8 +48,8 @@ class SampleComponent extends React.Component<Props> {
text='text'
/>

<WrappedText ref={generateTestHook('WrappedText')}>
Wrapped text
<WrappedText accessibilityRole='button' ref={generateTestHook('WrappedText')}>
Wrapped text
</WrappedText>

<Text>{foo}</Text>
Expand Down
3 changes: 2 additions & 1 deletion types/cavy/index.d.ts
Expand Up @@ -6,6 +6,7 @@
// TypeScript Version: 3.0

import * as React from 'react';
import * as ReactNative from 'react-native';

// Turn off automatic exporting by exporting {}.
export {};
Expand All @@ -22,7 +23,7 @@ export function hook<P extends {}>(WrappedComponent: React.ComponentClass<WithTe

export function useCavy(): TestHookGenerator;

export function wrap<P extends {}>(WrappedComponent: {} | React.FunctionComponent<P>): React.ComponentClass<P>;
export function wrap<P extends {}>(WrappedComponent: React.ComponentClass<P> | React.FunctionComponent<P>): React.ComponentClass<P>;

export interface TesterProps {
children: React.ReactElement;
Expand Down

0 comments on commit 9760dea

Please sign in to comment.