Skip to content

chore: rename default branch to main #784

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
version: 2

aliases:
- &filter-only-master
- &filter-only-main
branches:
only:
- master
- &filter-ignore-master
- main
- &filter-ignore-main
branches:
ignore:
- master
- main

defaults: &defaults
docker:
Expand Down Expand Up @@ -102,12 +102,12 @@ workflows:
requires:
- install-dependencies
# docusuarus build is running when deploying website as well
filters: *filter-ignore-master
filters: *filter-ignore-main
- test-examples:
requires:
- install-dependencies
filters: *filter-only-master
filters: *filter-only-main
- deploy-website:
requires:
- install-dependencies
filters: *filter-only-master
filters: *filter-only-main
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The core team works directly on GitHub and all work is public.

> **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).

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/)).
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/)).
2. Run `yarn` to setup the development environment.
3. Do the changes you want and test them out in the example app before sending a pull request.

Expand Down Expand Up @@ -49,7 +49,7 @@ When you're sending a pull request:

### Publishing a release

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:
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:

```sh
yarn release
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
height="80"
width="80"
alt="owl"
src="https://raw.githubusercontent.com/callstack/react-native-testing-library/master/website/static/img/owl.png"
src="https://raw.githubusercontent.com/callstack/react-native-testing-library/main/website/static/img/owl.png"
/>
<p>Simple and complete React Native testing utilities that encourage good testing practices.</P>
</div>
Expand Down Expand Up @@ -126,7 +126,7 @@ test('form submits two answers', () => {
});
```

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).
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).

## API / Usage

Expand Down
16 changes: 8 additions & 8 deletions flow-typed/npm/react-test-renderer_v16.x.x.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ type ReactComponentInstance = React$Component<any>;
type ReactTestRendererJSON = {
type: string,
props: { [propName: string]: any },
children: null | ReactTestRendererJSON[]
children: null | ReactTestRendererJSON[],
};

type ReactTestRendererTree = ReactTestRendererJSON & {
nodeType: "component" | "host",
nodeType: 'component' | 'host',
instance: ?ReactComponentInstance,
rendered: null | ReactTestRendererTree
rendered: null | ReactTestRendererTree,
};

type ReactTestInstance = {
Expand All @@ -40,21 +40,21 @@ type ReactTestInstance = {
findAllByProps(
props: { [propName: string]: any },
options?: { deep: boolean }
): ReactTestInstance[]
): ReactTestInstance[],
};

type TestRendererOptions = {
createNodeMock(element: React$Element<any>): any
createNodeMock(element: React$Element<any>): any,
};

declare module "react-test-renderer" {
declare module 'react-test-renderer' {
declare export type ReactTestRenderer = {
toJSON(): null | ReactTestRendererJSON,
toTree(): null | ReactTestRendererTree,
unmount(nextElement?: React$Element<any>): void,
update(nextElement: React$Element<any>): void,
getInstance(): ?ReactComponentInstance,
root: ReactTestInstance
root: ReactTestInstance,
};

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

declare module "react-test-renderer/shallow" {
declare module 'react-test-renderer/shallow' {
declare export default class ShallowRenderer {
static createRenderer(): ShallowRenderer;
getMountedInstance(): ReactTestInstance;
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/timers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Most content of this file sourced directly from https://github.com/testing-library/dom-testing-library/blob/master/src/helpers.js
// Most content of this file sourced directly from https://github.com/testing-library/dom-testing-library/blob/main/src/helpers.js
// @flow
/* globals jest */

Expand Down
10 changes: 5 additions & 5 deletions website/docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This page gathers public API of React Native Testing Library along with usage ex

## `render`

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

Defined as:

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

## `waitFor`

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

Defined as:

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

## `waitForElementToBeRemoved`

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

Defined as:

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

## `within`, `getQueriesForElement`

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

Defined as:

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

## `act`

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]).
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]).
4 changes: 2 additions & 2 deletions website/docs/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The React Native Testing Library (RNTL) is a lightweight solution for testing Re

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.

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).
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).

## Installation

Expand Down Expand Up @@ -99,4 +99,4 @@ test('form submits two answers', () => {
});
```

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).
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).
16 changes: 8 additions & 8 deletions website/docs/ReactNavigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Install the packages required for React Navigation. For this example, we will us
$ 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
```

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:
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:

```jsx
import 'react-native-gesture-handler';
Expand All @@ -39,7 +39,7 @@ export default function Navigation() {
}
```

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:
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:

```jsx
import * as React from 'react';
Expand Down Expand Up @@ -94,7 +94,7 @@ const styles = StyleSheet.create({
});
```

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:
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:

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

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.

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:
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:

```jsx
import * as React from 'react';
Expand Down Expand Up @@ -218,12 +218,12 @@ Install the packages required for React Navigation. For this example, we will us
$ 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
```

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:
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:

```jsx
import 'react-native-gesture-handler';
import React from 'react';
import {createDrawerNavigator} from '@react-navigation/drawer';
import { createDrawerNavigator } from '@react-navigation/drawer';

const { Screen, Navigator } = createDrawerNavigator();

Expand Down Expand Up @@ -270,7 +270,7 @@ Install required dev dependencies:
$ yarn add -D jest @testing-library/react-native
```

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

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

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.

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:
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:

```jsx
import React from 'react';
Expand Down
2 changes: 1 addition & 1 deletion website/docs/ReduxIntegration.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This section deals with testing RN applications developed with Redux. We will be

## Setting up

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

## Test cases

Expand Down
4 changes: 2 additions & 2 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ const siteConfig = {
docs: {
sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo.
editUrl: `${repoUrl}/blob/master`,
editUrl: `${repoUrl}/blob/main`,
},
blog: {
showReadingTime: true,
// Please change this to your repo.
editUrl: `${repoUrl}/blob/master/blog`,
editUrl: `${repoUrl}/blob/main/blog`,
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
Expand Down