Skip to content

Commit

Permalink
docs: v1 migration guide (#474)
Browse files Browse the repository at this point in the history
* docs: migration guide

* docs: tabs
  • Loading branch information
mdjastrzebski authored Apr 26, 2024
1 parent 19e14b3 commit 5708d67
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 8 deletions.
27 changes: 19 additions & 8 deletions docusaurus/docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,25 @@
sidebar_position: 2
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Installation and setup

In order to install Reassure run following command in your app folder:

Using yarn

<Tabs>
<TabItem value="npm" label="npm">
```sh
yarn add --dev reassure
npm install --save-dev reassure
```

Using npm

</TabItem>
<TabItem value="yarn" label="yarn">
```sh
npm install --save-dev reassure
yarn add --dev reassure
```
</TabItem>
</Tabs>

You will also need a working [Jest](https://jestjs.io/docs/getting-started) setup as well as one of either [React Native Testing Library](https://github.com/callstack/react-native-testing-library#installation) or [React Testing Library](https://testing-library.com/docs/react-testing-library/intro).

Expand All @@ -30,11 +34,18 @@ You can check our example projects:
Reassure will try to detect which Testing Library you have installed. In case both React Native Testing Library and React Testing Library are present it will
warn you about that and give a precedence to React Native Testing Library. You can explicitly specify Testing Library to by used by using [`configure`](#configure-function) option:

<Tabs>
<TabItem value="react-native" label="React Native">
```ts
configure({ testingLibrary: 'react-native' });
// or
```
</TabItem>
<TabItem value="react" label="React.js">
```ts
configure({ testingLibrary: 'react' });
```
</TabItem>
</Tabs>

You should set it in your Jest setup file and you can override it in particular test files if needed.

Expand Down
36 changes: 36 additions & 0 deletions docusaurus/docs/migration-v1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: Migration to v1.x
sidebar_position: 6
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Migration to v1.x

## Installation

Reassure v1 RC is available using `next` npm tag:

<Tabs>
<TabItem value="npm" label="npm">
```sh
npm install --save-dev reassure@next
```
</TabItem>
<TabItem value="yarn" label="yarn">
```sh
yarn add --dev reassure@next
```
</TabItem>
</Tabs>

## Breaking changes

### Rename `measurePerformance` to `measureRenders`

The signature of the function did not change. Old name is still available but will generate warning messages when used.

### Rename `resetToDefault` to `resetToDefaults`

The signature of the function did not change. Old name is no longer available.

0 comments on commit 5708d67

Please sign in to comment.