A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://callstack.github.io/react-native-testing-library/docs/start/quick-start below:

Quick Start - React Native Testing Library

Quick Start# Installation#

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

yarn add -D @testing-library/react-native

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

Jest matchers#

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.

ESLint plugin#

We recommend setting up eslint-plugin-testing-library package to help you avoid common Testing Library mistakes and bad practices.

Install the plugin (assuming you already have eslint installed & configured):

yarn add -D eslint-plugin-testing-library

Then, add relevant entry to your ESLint config (e.g., .eslintrc.js). We recommend extending the react plugin:

.eslintrc.js

module.exports = {
  overrides: [
    {
      // Test files only
      files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
      extends: ['plugin:testing-library/react'],
    },
  ],
};

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4