From 872b8fde2857cd24a1cdc3eabe679d888cadf0d3 Mon Sep 17 00:00:00 2001 From: daveols <10344370+daveols@users.noreply.github.com> Date: Tue, 14 Jul 2020 18:51:45 +1000 Subject: [PATCH 1/2] add Pressable to list of supported components --- docs/install.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/install.md b/docs/install.md index 303242a..5349cf1 100644 --- a/docs/install.md +++ b/docs/install.md @@ -12,16 +12,17 @@ This module should be installed in your project's `devDependencies`: npm install --save-dev @testing-library/react-native ``` -You will need `react`, `react-native`, and `react-test-renderer` installed as _dependencies_ in order to run this project. +You will need `react`, `react-native`, and `react-test-renderer` installed as _dependencies_ in +order to run this project. ## Jest preset > It is **highly recommended** that you use the bundled Jest preset. You will likely experience > unexpected behavior and have a sub-optimal experience if you do not use the preset. -This library includes an easy to adopt and reliable Jest preset to maximize the -confidence you have in your tests. It extends the `react-native` preset, and was created in order to -more closely mimic behavior you would expect from any other member of the `testing-library` family. +This library includes an easy to adopt and reliable Jest preset to maximize the confidence you have +in your tests. It extends the `react-native` preset, and was created in order to more closely mimic +behavior you would expect from any other member of the `testing-library` family. ```diff // jest.config.js @@ -43,8 +44,8 @@ module.exports = Object.assign(expoPreset, jestPreset, { }); ``` -> If you use Expo, be sure to include the Expo setup files before this library's setup -> files! If you're using React Native, there's no need to do anything extra. +> If you use Expo, be sure to include the Expo setup files before this library's setup files! If +> you're using React Native, there's no need to do anything extra. Generally speaking though, it's better to include any setup files you have in the `setupFilesAfterEnv` key of your Jest config. @@ -63,6 +64,7 @@ Here is a list of all the components this preset supports: "Image", "Modal", "Picker", + "Pressable", "RefreshControl", "SafeAreaView", "ScrollView", From d518bce45268558f17ca4c08220998c857aad989 Mon Sep 17 00:00:00 2001 From: daveols <10344370+daveols@users.noreply.github.com> Date: Tue, 14 Jul 2020 18:52:46 +1000 Subject: [PATCH 2/2] run prettier against src --- docker-compose.yml | 2 +- docs/api-helpers.md | 8 +-- docs/api-main.md | 8 +-- docs/api-queries.md | 4 +- docs/api-test-instance.md | 2 +- docs/cheat-sheet.md | 4 +- docs/ecosystem-jest-native.md | 4 +- docs/example-context.md | 2 +- docs/example-input-event.md | 4 +- docs/example-intl.md | 2 +- docs/example-navigation.md | 8 ++- docs/example-redux.md | 2 +- docs/intro.md | 21 ++++---- docs/setup.md | 10 ++-- website/README.md | 27 ++++++---- website/blog/2016-03-11-blog-post.md | 40 +++++++++++++-- website/blog/2017-04-10-blog-post-two.md | 40 +++++++++++++-- website/blog/2017-09-25-testing-rss.md | 3 ++ website/pages/en/index.js | 18 +++---- website/pages/en/users.js | 2 +- website/pages/en/versions.js | 2 +- website/siteConfig.js | 5 +- website/static/css/code-block-buttons.css | 40 +++++++-------- website/static/css/custom.css | 12 ++--- website/static/js/code-block-buttons.js | 51 +++++++++---------- .../version-2.0.0/api-queries.md | 4 +- .../version-2.0.0/example-context.md | 2 +- .../version-2.0.0/example-input-event.md | 4 +- .../version-2.0.0/example-intl.md | 2 +- .../version-2.0.0/example-navigation.md | 2 +- .../version-2.0.0/example-redux.md | 2 +- .../version-2.0.0/guide-queries.md | 2 +- .../version-2.0.0/hook-example-async.md | 4 +- .../version-2.0.0/hook-example-custom.md | 4 +- .../version-2.0.0/hook-example-error.md | 4 +- .../version-2.0.0/hook-example-test.md | 6 +-- .../versioned_docs/version-3.0.0/api-act.md | 5 +- .../versioned_docs/version-3.0.0/api-main.md | 2 +- .../version-3.0.0/api-queries.md | 4 +- .../version-3.0.0/api-test-instance.md | 2 +- .../version-3.0.0/example-input-event.md | 4 +- .../version-3.0.0/example-update-props.md | 1 - .../version-4.0.0/api-helpers.md | 8 +-- .../versioned_docs/version-4.0.0/api-main.md | 2 +- .../version-4.0.0/api-queries.md | 4 +- .../version-4.0.0/cheat-sheet.md | 4 +- .../version-4.0.0/ecosystem-jest-native.md | 4 +- .../version-4.0.0/example-context.md | 2 +- .../version-4.0.0/example-input-event.md | 4 +- .../version-4.0.0/example-intl.md | 2 +- .../version-4.0.0/example-navigation.md | 2 +- .../version-4.0.0/example-redux.md | 2 +- .../versioned_docs/version-4.0.0/install.md | 13 ++--- website/versioned_docs/version-4.0.0/intro.md | 21 ++++---- website/versioned_docs/version-4.0.0/setup.md | 10 ++-- .../version-2.0.0-sidebars.json | 9 +--- .../version-3.0.0-sidebars.json | 9 +--- website/versions.json | 6 +-- 58 files changed, 267 insertions(+), 210 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 6711192..1fcc0e1 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: "3" +version: '3' services: docusaurus: diff --git a/docs/api-helpers.md b/docs/api-helpers.md index 591ca57..ec6d033 100644 --- a/docs/api-helpers.md +++ b/docs/api-helpers.md @@ -6,11 +6,11 @@ sidebar_label: Helpers ## Custom Queries -A few helper functions are exposed that are used internally to implement the default queries. You can -use the helpers to build custom queries. For example, the code below shows a way to query your +A few helper functions are exposed that are used internally to implement the default queries. You +can use the helpers to build custom queries. For example, the code below shows a way to query your TestInstance by a `style` prop. Note: test files would need to now import `test-utils.js` instead of -importing directly from `@testing-library/react-native`. Also note, please never actually implement this helper, it's just an -example of what's possible. +importing directly from `@testing-library/react-native`. Also note, please never actually implement +this helper, it's just an example of what's possible. ```javascript // test-utils.js diff --git a/docs/api-main.md b/docs/api-main.md index 8bf0b81..6a2f804 100644 --- a/docs/api-main.md +++ b/docs/api-main.md @@ -160,7 +160,7 @@ function TestComponent() { const [count, setCount] = React.useState(0); return ( -