From 7d2409e17e0723becef9aa65cf402202d4d5cfc2 Mon Sep 17 00:00:00 2001 From: Nick McCurdy Date: Sat, 17 Jul 2021 23:25:17 -0400 Subject: [PATCH] chore: rename default branch to main --- .circleci/config.yml | 14 +++++++------- CONTRIBUTING.md | 4 ++-- README.md | 4 ++-- flow-typed/npm/react-test-renderer_v16.x.x.js | 16 ++++++++-------- src/helpers/timers.js | 2 +- website/docs/API.md | 10 +++++----- website/docs/GettingStarted.md | 4 ++-- website/docs/ReactNavigation.md | 16 ++++++++-------- website/docs/ReduxIntegration.md | 2 +- website/docusaurus.config.js | 4 ++-- 10 files changed, 38 insertions(+), 38 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ebba0ff18..e520dae89 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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: @@ -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 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5951059da..799c149b5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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. @@ -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 diff --git a/README.md b/README.md index c785aa729..63c88b236 100644 --- a/README.md +++ b/README.md @@ -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" />

Simple and complete React Native testing utilities that encourage good testing practices.

@@ -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 diff --git a/flow-typed/npm/react-test-renderer_v16.x.x.js b/flow-typed/npm/react-test-renderer_v16.x.x.js index 4cb3b4577..87a149a1d 100644 --- a/flow-typed/npm/react-test-renderer_v16.x.x.js +++ b/flow-typed/npm/react-test-renderer_v16.x.x.js @@ -9,13 +9,13 @@ type ReactComponentInstance = React$Component; 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 = { @@ -40,21 +40,21 @@ type ReactTestInstance = { findAllByProps( props: { [propName: string]: any }, options?: { deep: boolean } - ): ReactTestInstance[] + ): ReactTestInstance[], }; type TestRendererOptions = { - createNodeMock(element: React$Element): any + createNodeMock(element: React$Element): 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): void, update(nextElement: React$Element): void, getInstance(): ?ReactComponentInstance, - root: ReactTestInstance + root: ReactTestInstance, }; declare type Thenable = { @@ -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; diff --git a/src/helpers/timers.js b/src/helpers/timers.js index bc9080bde..95868d683 100644 --- a/src/helpers/timers.js +++ b/src/helpers/timers.js @@ -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 */ diff --git a/website/docs/API.md b/website/docs/API.md index c2d57f1a7..bef768012 100644 --- a/website/docs/API.md +++ b/website/docs/API.md @@ -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: @@ -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: @@ -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: @@ -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: @@ -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]). diff --git a/website/docs/GettingStarted.md b/website/docs/GettingStarted.md index 536e96503..b0ff3f738 100644 --- a/website/docs/GettingStarted.md +++ b/website/docs/GettingStarted.md @@ -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 @@ -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). diff --git a/website/docs/ReactNavigation.md b/website/docs/ReactNavigation.md index 5f0f0ef34..b6a519de5 100644 --- a/website/docs/ReactNavigation.md +++ b/website/docs/ReactNavigation.md @@ -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'; @@ -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'; @@ -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 @@ -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'; @@ -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(); @@ -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'; @@ -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'; diff --git a/website/docs/ReduxIntegration.md b/website/docs/ReduxIntegration.md index 04875a346..0a6b252af 100644 --- a/website/docs/ReduxIntegration.md +++ b/website/docs/ReduxIntegration.md @@ -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 diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 28078e7a4..9ed4b92f5 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -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'),