Skip to content

Commit b6ec6b0

Browse files
authoredOct 15, 2021
chore: rename default branch to main (#784)
1 parent 7726a6d commit b6ec6b0

10 files changed

+38
-38
lines changed
 

‎.circleci/config.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
version: 2
22

33
aliases:
4-
- &filter-only-master
4+
- &filter-only-main
55
branches:
66
only:
7-
- master
8-
- &filter-ignore-master
7+
- main
8+
- &filter-ignore-main
99
branches:
1010
ignore:
11-
- master
11+
- main
1212

1313
defaults: &defaults
1414
docker:
@@ -102,12 +102,12 @@ workflows:
102102
requires:
103103
- install-dependencies
104104
# docusuarus build is running when deploying website as well
105-
filters: *filter-ignore-master
105+
filters: *filter-ignore-main
106106
- test-examples:
107107
requires:
108108
- install-dependencies
109-
filters: *filter-only-master
109+
filters: *filter-only-main
110110
- deploy-website:
111111
requires:
112112
- install-dependencies
113-
filters: *filter-only-master
113+
filters: *filter-only-main

‎CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The core team works directly on GitHub and all work is public.
1212

1313
> **Working on your first pull request?** You can learn how from this _free_ series: [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github).
1414
15-
1. Fork the repo and create your branch from `master` (a guide on [how to fork a repository](https://help.github.com/articles/fork-a-repo/)).
15+
1. Fork the repo and create your branch from `main` (a guide on [how to fork a repository](https://help.github.com/articles/fork-a-repo/)).
1616
2. Run `yarn` to setup the development environment.
1717
3. Do the changes you want and test them out in the example app before sending a pull request.
1818

@@ -49,7 +49,7 @@ When you're sending a pull request:
4949

5050
### Publishing a release
5151

52-
We use [release-it](https://github.com/webpro/release-it) to automate our release. If you have publish access to the NPM package, run the following from the master branch to publish a new release:
52+
We use [release-it](https://github.com/webpro/release-it) to automate our release. If you have publish access to the NPM package, run the following from the main branch to publish a new release:
5353

5454
```sh
5555
yarn release

‎README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
height="80"
55
width="80"
66
alt="owl"
7-
src="https://raw.githubusercontent.com/callstack/react-native-testing-library/master/website/static/img/owl.png"
7+
src="https://raw.githubusercontent.com/callstack/react-native-testing-library/main/website/static/img/owl.png"
88
/>
99
<p>Simple and complete React Native testing utilities that encourage good testing practices.</P>
1010
</div>
@@ -126,7 +126,7 @@ test('form submits two answers', () => {
126126
});
127127
```
128128

129-
You can find the source of `QuestionsBoard` component and this example [here](https://github.com/callstack/react-native-testing-library/blob/master/src/__tests__/questionsBoard.test.js).
129+
You can find the source of `QuestionsBoard` component and this example [here](https://github.com/callstack/react-native-testing-library/blob/main/src/__tests__/questionsBoard.test.js).
130130

131131
## API / Usage
132132

‎flow-typed/npm/react-test-renderer_v16.x.x.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ type ReactComponentInstance = React$Component<any>;
99
type ReactTestRendererJSON = {
1010
type: string,
1111
props: { [propName: string]: any },
12-
children: null | ReactTestRendererJSON[]
12+
children: null | ReactTestRendererJSON[],
1313
};
1414

1515
type ReactTestRendererTree = ReactTestRendererJSON & {
16-
nodeType: "component" | "host",
16+
nodeType: 'component' | 'host',
1717
instance: ?ReactComponentInstance,
18-
rendered: null | ReactTestRendererTree
18+
rendered: null | ReactTestRendererTree,
1919
};
2020

2121
type ReactTestInstance = {
@@ -40,21 +40,21 @@ type ReactTestInstance = {
4040
findAllByProps(
4141
props: { [propName: string]: any },
4242
options?: { deep: boolean }
43-
): ReactTestInstance[]
43+
): ReactTestInstance[],
4444
};
4545

4646
type TestRendererOptions = {
47-
createNodeMock(element: React$Element<any>): any
47+
createNodeMock(element: React$Element<any>): any,
4848
};
4949

50-
declare module "react-test-renderer" {
50+
declare module 'react-test-renderer' {
5151
declare export type ReactTestRenderer = {
5252
toJSON(): null | ReactTestRendererJSON,
5353
toTree(): null | ReactTestRendererTree,
5454
unmount(nextElement?: React$Element<any>): void,
5555
update(nextElement: React$Element<any>): void,
5656
getInstance(): ?ReactComponentInstance,
57-
root: ReactTestInstance
57+
root: ReactTestInstance,
5858
};
5959

6060
declare type Thenable = {
@@ -69,7 +69,7 @@ declare module "react-test-renderer" {
6969
declare function act(callback: () => void): Thenable;
7070
}
7171

72-
declare module "react-test-renderer/shallow" {
72+
declare module 'react-test-renderer/shallow' {
7373
declare export default class ShallowRenderer {
7474
static createRenderer(): ShallowRenderer;
7575
getMountedInstance(): ReactTestInstance;

‎src/helpers/timers.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Most content of this file sourced directly from https://github.com/testing-library/dom-testing-library/blob/master/src/helpers.js
1+
// Most content of this file sourced directly from https://github.com/testing-library/dom-testing-library/blob/main/src/helpers.js
22
// @flow
33
/* globals jest */
44

‎website/docs/API.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This page gathers public API of React Native Testing Library along with usage ex
77

88
## `render`
99

10-
- [`Example code`](https://github.com/callstack/react-native-testing-library/blob/master/src/__tests__/render.test.js)
10+
- [`Example code`](https://github.com/callstack/react-native-testing-library/blob/main/src/__tests__/render.test.js)
1111

1212
Defined as:
1313

@@ -339,7 +339,7 @@ If you're noticing that components are not being found on a list, even after moc
339339

340340
## `waitFor`
341341

342-
- [`Example code`](https://github.com/callstack/react-native-testing-library/blob/master/src/__tests__/waitFor.test.js)
342+
- [`Example code`](https://github.com/callstack/react-native-testing-library/blob/main/src/__tests__/waitFor.test.js)
343343

344344
Defined as:
345345

@@ -368,7 +368,7 @@ In order to properly use `waitFor` you need at least React >=16.9.0 (featuring a
368368

369369
## `waitForElementToBeRemoved`
370370

371-
- [`Example code`](https://github.com/callstack/react-native-testing-library/blob/master/src/__tests__/waitForElementToBeRemoved.test.js)
371+
- [`Example code`](https://github.com/callstack/react-native-testing-library/blob/main/src/__tests__/waitForElementToBeRemoved.test.js)
372372

373373
Defined as:
374374

@@ -404,7 +404,7 @@ In order to properly use `waitForElementToBeRemoved` you need at least React >=1
404404

405405
## `within`, `getQueriesForElement`
406406

407-
- [`Example code`](https://github.com/callstack/react-native-testing-library/blob/master/src/__tests__/within.test.js)
407+
- [`Example code`](https://github.com/callstack/react-native-testing-library/blob/main/src/__tests__/within.test.js)
408408

409409
Defined as:
410410

@@ -458,4 +458,4 @@ expect(submitButtons).toHaveLength(3); // expect 3 elements
458458

459459
## `act`
460460

461-
Useful function to help testing components that use hooks API. By default any `render`, `update`, `fireEvent`, and `waitFor` calls are wrapped by this function, so there is no need to wrap it manually. This method is re-exported from [`react-test-renderer`](https://github.com/facebook/react/blob/master/packages/react-test-renderer/src/ReactTestRenderer.js#L567]).
461+
Useful function to help testing components that use hooks API. By default any `render`, `update`, `fireEvent`, and `waitFor` calls are wrapped by this function, so there is no need to wrap it manually. This method is re-exported from [`react-test-renderer`](https://github.com/facebook/react/blob/main/packages/react-test-renderer/src/ReactTestRenderer.js#L567]).

‎website/docs/GettingStarted.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The React Native Testing Library (RNTL) is a lightweight solution for testing Re
1515
1616
This project is inspired by [React Testing Library](https://github.com/testing-library/react-testing-library). Tested to work with Jest, but it should work with other test runners as well.
1717

18-
You can find the source of `QuestionsBoard` component and this example [here](https://github.com/callstack/react-native-testing-library/blob/master/src/__tests__/questionsBoard.test.js).
18+
You can find the source of `QuestionsBoard` component and this example [here](https://github.com/callstack/react-native-testing-library/blob/main/src/__tests__/questionsBoard.test.js).
1919

2020
## Installation
2121

@@ -99,4 +99,4 @@ test('form submits two answers', () => {
9999
});
100100
```
101101

102-
You can find the source of `QuestionsBoard` component and this example [here](https://github.com/callstack/react-native-testing-library/blob/master/src/__tests__/questionsBoard.test.js).
102+
You can find the source of `QuestionsBoard` component and this example [here](https://github.com/callstack/react-native-testing-library/blob/main/src/__tests__/questionsBoard.test.js).

‎website/docs/ReactNavigation.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Install the packages required for React Navigation. For this example, we will us
1515
$ yarn add @react-native-community/masked-view @react-navigation/native @react-navigation/stack react-native-gesture-handler react-native-reanimated react-native-safe-area-context react-native-screens
1616
```
1717

18-
Create an [`./AppNavigator.js`](https://github.com/callstack/react-native-testing-library/blob/master/examples/reactnavigation/src/AppNavigator.js) component which will list the navigation stack:
18+
Create an [`./AppNavigator.js`](https://github.com/callstack/react-native-testing-library/blob/main/examples/reactnavigation/src/AppNavigator.js) component which will list the navigation stack:
1919

2020
```jsx
2121
import 'react-native-gesture-handler';
@@ -39,7 +39,7 @@ export default function Navigation() {
3939
}
4040
```
4141

42-
Create your two screens which we will transition to and from them. The homescreen, found in [`./screens/HomeScreen.js`](https://github.com/callstack/react-native-testing-library/blob/master/examples/reactnavigation/src/screens/HomeScreen.js), contains a list of elements presented in a list view. On tap of any of these items will move to the details screen with the item number:
42+
Create your two screens which we will transition to and from them. The homescreen, found in [`./screens/HomeScreen.js`](https://github.com/callstack/react-native-testing-library/blob/main/examples/reactnavigation/src/screens/HomeScreen.js), contains a list of elements presented in a list view. On tap of any of these items will move to the details screen with the item number:
4343

4444
```jsx
4545
import * as React from 'react';
@@ -94,7 +94,7 @@ const styles = StyleSheet.create({
9494
});
9595
```
9696

97-
The details screen, found in [`./screens/DetailsScreen.js`](https://github.com/callstack/react-native-testing-library/blob/master/examples/reactnavigation/src/screens/DetailsScreen.js), contains a header with the item number passed from the home screen:
97+
The details screen, found in [`./screens/DetailsScreen.js`](https://github.com/callstack/react-native-testing-library/blob/main/examples/reactnavigation/src/screens/DetailsScreen.js), contains a header with the item number passed from the home screen:
9898

9999
```jsx
100100
// ./screens/DetailsScreen.js
@@ -153,7 +153,7 @@ Notice the 2 entries that don't come with the default React Native project:
153153

154154
For this example, we are going to test out two things. The first thing is that the page is laid out as expected. The second, and most important, is that the page will transition to the detail screen when any item is tapped on.
155155

156-
Let's add a [`AppNavigator.test.js`](https://github.com/callstack/react-native-testing-library/blob/master/examples/reactnavigation/src/__tests__/AppNavigator.js) file in `src/__tests__` directory:
156+
Let's add a [`AppNavigator.test.js`](https://github.com/callstack/react-native-testing-library/blob/main/examples/reactnavigation/src/__tests__/AppNavigator.js) file in `src/__tests__` directory:
157157

158158
```jsx
159159
import * as React from 'react';
@@ -218,12 +218,12 @@ Install the packages required for React Navigation. For this example, we will us
218218
$ yarn add @react-native-community/masked-view @react-navigation/native @react-navigation/drawer react-native-gesture-handler react-native-reanimated react-native-safe-area-context react-native-screens
219219
```
220220

221-
Create a [`./DrawerAppNavigator.js`](https://github.com/callstack/react-native-testing-library/blob/master/examples/reactnavigation/src/DrawerAppNavigator.js) component which will list the navigation stack:
221+
Create a [`./DrawerAppNavigator.js`](https://github.com/callstack/react-native-testing-library/blob/main/examples/reactnavigation/src/DrawerAppNavigator.js) component which will list the navigation stack:
222222

223223
```jsx
224224
import 'react-native-gesture-handler';
225225
import React from 'react';
226-
import {createDrawerNavigator} from '@react-navigation/drawer';
226+
import { createDrawerNavigator } from '@react-navigation/drawer';
227227

228228
const { Screen, Navigator } = createDrawerNavigator();
229229

@@ -270,7 +270,7 @@ Install required dev dependencies:
270270
$ yarn add -D jest @testing-library/react-native
271271
```
272272

273-
Create a [`mock file`](https://github.com/callstack/react-native-testing-library/blob/master/examples/reactnavigation/jest-setup.js) necessary for your tests:
273+
Create a [`mock file`](https://github.com/callstack/react-native-testing-library/blob/main/examples/reactnavigation/jest-setup.js) necessary for your tests:
274274

275275
```jsx
276276
import 'react-native-gesture-handler/jestSetup';
@@ -309,7 +309,7 @@ This setup is copied from the [React Navigation documentation](https://reactnavi
309309

310310
For this example, we are going to test out two things. The first thing is that the screen is loaded correctly. The second, and most important, is that the page will transition to the notifications screen when the button is tapped on.
311311

312-
Let's add a [`DrawerAppNavigator.test.js`](https://github.com/callstack/react-native-testing-library/blob/master/examples/reactnavigation/src/__tests__/DrawerAppNavigator.js) file in `src/__tests__` directory:
312+
Let's add a [`DrawerAppNavigator.test.js`](https://github.com/callstack/react-native-testing-library/blob/main/examples/reactnavigation/src/__tests__/DrawerAppNavigator.js) file in `src/__tests__` directory:
313313

314314
```jsx
315315
import React from 'react';

‎website/docs/ReduxIntegration.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This section deals with testing RN applications developed with Redux. We will be
77

88
## Setting up
99

10-
An example of setting up can be found [here](https://github.com/callstack/react-native-testing-library/tree/master/examples/redux).
10+
An example of setting up can be found [here](https://github.com/callstack/react-native-testing-library/tree/main/examples/redux).
1111

1212
## Test cases
1313

‎website/docusaurus.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,12 @@ const siteConfig = {
9595
docs: {
9696
sidebarPath: require.resolve('./sidebars.js'),
9797
// Please change this to your repo.
98-
editUrl: `${repoUrl}/blob/master`,
98+
editUrl: `${repoUrl}/blob/main`,
9999
},
100100
blog: {
101101
showReadingTime: true,
102102
// Please change this to your repo.
103-
editUrl: `${repoUrl}/blob/master/blog`,
103+
editUrl: `${repoUrl}/blob/main/blog`,
104104
},
105105
theme: {
106106
customCss: require.resolve('./src/css/custom.css'),

0 commit comments

Comments
 (0)
Please sign in to comment.