mirror of
https://github.com/callstack/react-native-testing-library.git
synced 2026-09-18 23:09:04 +08:00
docs: fix small issues
This commit is contained in:
@@ -69,7 +69,11 @@ Each query has a default `timeout` value of 1000 ms and a default `interval` of
|
||||
#### Example
|
||||
|
||||
```typescript
|
||||
const button = await screen.findByRole('button'), { name: 'Start' }, { timeout: 1000, interval: 50 });
|
||||
const button = await screen.findByRole(
|
||||
'button',
|
||||
{ name: 'Start' },
|
||||
{ timeout: 1000, interval: 50 }
|
||||
);
|
||||
```
|
||||
|
||||
Alternatively, a default global `timeout` value can be set using the [`configure` function](docs/api/misc/config#configure):
|
||||
|
||||
@@ -123,7 +123,9 @@ You can also transform prop values so that they are more readable (e.g., flatten
|
||||
```ts
|
||||
import { StyleSheet } from 'react-native';
|
||||
|
||||
screen.debug({ mapProps : {({ style, ...props })} => ({ style : StyleSheet.flatten(style), ...props }) });
|
||||
screen.debug({
|
||||
mapProps: ({ style, ...props }) => ({ style: StyleSheet.flatten(style), ...props }),
|
||||
});
|
||||
```
|
||||
|
||||
Or remove props that have little value when debugging tests, e.g. path prop for svgs
|
||||
|
||||
Reference in New Issue
Block a user