From 557e8fc7a0a8256f5fc2d749b37e336b45be6375 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Sat, 30 May 2020 20:02:43 +0200 Subject: [PATCH] docs: clarify configuration to incluude preset react-native --- README.md | 11 ++++++----- website/docs/GettingStarted.md | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 882c2a7a0..d09b10f23 100644 --- a/README.md +++ b/README.md @@ -94,12 +94,13 @@ yarn add --dev @testing-library/jest-native npm install --save-dev @testing-library/jest-native ``` -Then automatically add it to your jest tests by using `setupFilesAfterEnv` option in the `jest.config.js` file: +Then automatically add it to your jest tests by using `setupFilesAfterEnv` option in your Jest configuration (it's usually located either in `package.json` under `"jest"` key or in a `jest.config.js` file): -```js -module.exports = { - setupFilesAfterEnv: ['@testing-library/jest-native/extend-expect'], -}; +```json +{ + "preset": "react-native", + "setupFilesAfterEnv": ["@testing-library/jest-native/extend-expect"] +} ``` ### Flow diff --git a/website/docs/GettingStarted.md b/website/docs/GettingStarted.md index ebe68f750..9ba8587b9 100644 --- a/website/docs/GettingStarted.md +++ b/website/docs/GettingStarted.md @@ -86,10 +86,11 @@ yarn add --dev @testing-library/jest-native npm install --save-dev @testing-library/jest-native ``` -Then automatically add it to your jest tests by using `setupFilesAfterEnv` option in the `jest.config.js` file: +Then automatically add it to your jest tests by using `setupFilesAfterEnv` option in your Jest configuration (it's usually located either in `package.json` under `"jest"` key or in a `jest.config.js` file): -```js -module.exports = { - setupFilesAfterEnv: ['@testing-library/jest-native/extend-expect'], -}; +```json +{ + "preset": "react-native", + "setupFilesAfterEnv": ["@testing-library/jest-native/extend-expect"] +} ```