Skip to content

Commit 025bd57

Browse files
committed
chore: add v13 versioned docs
1 parent 6af05a2 commit 025bd57

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

website/docs/13.x/docs/start/intro.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Introduction
22

3+
:::warning
4+
5+
This guide is for version 13.x of React Native Testing Library which is currently in alpha!
6+
7+
:::
8+
39
## The problem
410

511
You want to write maintainable tests for your React Native components. As a part of this goal, you want your tests to avoid including implementation details of your components and focus on making your tests give you the confidence they are intended. As part of this, you want your tests to be maintainable in the long run so refactors of your components (changes to implementation but not functionality) don't break your tests and slow you and your team down.

website/docs/13.x/docs/start/quick-start.mdx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,28 @@ import { PackageManagerTabs } from 'rspress/theme';
22

33
# Quick Start
44

5+
:::warning
6+
7+
This guide is for version 13.x of React Native Testing Library which is currently in alpha!
8+
9+
:::
10+
511
## Installation
612

713
Open a Terminal in your project's folder and run:
814

915
<PackageManagerTabs
1016
command={{
11-
yarn: 'yarn add -D @testing-library/react-native',
12-
npm: 'npm install -D @testing-library/react-native',
17+
yarn: 'yarn add -D @testing-library/react-native@alpha',
18+
npm: 'npm install -D @testing-library/react-native@alpha',
1319
}}
1420
/>
1521

1622
This library has a peer dependency for `react-test-renderer` package. Make sure that your `react-test-renderer` version matches exactly your `react` version.
1723

1824
### Jest matchers
1925

20-
To set up React Native-specific Jest matchers, add the following line to your `jest-setup.ts` file (configured using [`setupFilesAfterEnv`](https://jestjs.io/docs/configuration#setupfilesafterenv-array)):
21-
22-
```ts title=jest-setup.ts
23-
import '@testing-library/react-native/extend-expect';
24-
```
26+
RNTL v13 automatically extends Jest with React Native-specific matchers. The only thing you need to do is to import anything from `@testing-library/react-native` which you already need to do to access the `render` function.
2527

2628
### ESLint plugin
2729

website/rspress.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default defineConfig({
1919
},
2020
multiVersion: {
2121
default: '12.x',
22-
versions: ['12.x'],
22+
versions: ['12.x', '13.x'],
2323
},
2424
route: {
2525
cleanUrls: true,

0 commit comments

Comments
 (0)