Files
react-native/packages/jest-preset

@react-native/jest-preset

npm npm downloads

Jest preset for React Native apps.

Usage

Installation

Install @react-native/jest-preset in your app:

with npm:

npm i @react-native/jest-preset --save-dev

or with yarn:

yarn add -D @react-native/jest-preset

Configuring Jest

Then, create a file called jest.config.js in your project's root directory. Then load this preset:

module.exports = {
  preset: '@react-native/jest-preset',
};

You can further customize your Jest configuration by specifying other options. See Jest's jest.config.js documentation to learn more.