Skip to content

feat: upgrade @testing-library/react-native to 13.2.0#14450

Merged
Prithpal-Sooriya merged 7 commits into
mainfrom
upgrade-testing-library-react-native
Apr 7, 2025
Merged

feat: upgrade @testing-library/react-native to 13.2.0#14450
Prithpal-Sooriya merged 7 commits into
mainfrom
upgrade-testing-library-react-native

Conversation

@Prithpal-Sooriya

@Prithpal-Sooriya Prithpal-Sooriya commented Apr 4, 2025

Copy link
Copy Markdown
Contributor

Description

This upgrades @testing-library/react-native to v13!

Followed the migration guide here. It seems to not impact us.

NEW FEATURES - JEST MATCHERS
https://callstack.github.io/react-native-testing-library/docs/api/jest-matchers

As long as you have imported something from '@testing-library/react-native', you will get extended jest matchers to write more accurate and easier to read assertions!

// This is bad since an element returned can be `null`, which is technically an object!
expect(component).toBeDefined()

// This is okay, but can still have false positives (e.g. `0 && <>` shortcuts)
// It is also really weird and hard to understand when first looking at it.
expect(component).toBeTruthy()

// NOW we can target elements on screen. A more easy to read/understand syntax
// Look through the other extended jest matchers we can also utilise: https://callstack.github.io/react-native-testing-library/docs/api/jest-matchers
expect(component).toBeOnTheScreen();

NEW FEATURES - CONCURRENT RENDERING
This adds support for React 18 concurrent rendering. Even if we don't support react 18, it will help us write better components and tests that handle:

  • prop & selector changes
  • useEffects
  • loading states

Related issues

Fixes:

Manual testing steps

Ensure that our existing test suite passes.

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@github-actions

github-actions Bot commented Apr 4, 2025

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@socket-security

socket-security Bot commented Apr 4, 2025

Copy link
Copy Markdown

New and updated dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@testing-library/react-native@12.1.213.2.0 None 0 666 kB mdjastrzebski
npm/min-indent@1.0.1 None 0 2.97 kB thejameskyle
npm/redent@3.0.0 None 0 3.6 kB sindresorhus
npm/strip-indent@3.0.0 None 0 3.31 kB sindresorhus

View full report↗︎

Comment thread app/util/test/testSetup.js
@codecov-commenter

codecov-commenter commented Apr 4, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.47%. Comparing base (44bb493) to head (c3f4859).
Report is 17 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #14450      +/-   ##
==========================================
+ Coverage   66.29%   66.47%   +0.17%     
==========================================
  Files        2248     2248              
  Lines       48037    48050      +13     
  Branches     6766     6782      +16     
==========================================
+ Hits        31848    31940      +92     
+ Misses      14172    14081      -91     
- Partials     2017     2029      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Apr 4, 2025

Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: e9938f3
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/60699c50-c473-408f-bb7d-a6a6a778e629

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

Comment thread app/selectors/accountTrackerControllerReRenders.test.tsx
@github-actions

github-actions Bot commented Apr 4, 2025

Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: c3f4859
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/7d1fec42-56de-4876-9e21-7cd2aa8c87d7

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@Prithpal-Sooriya Prithpal-Sooriya marked this pull request as ready for review April 4, 2025 22:06
@Prithpal-Sooriya Prithpal-Sooriya requested a review from a team April 4, 2025 22:06
@Prithpal-Sooriya Prithpal-Sooriya requested a review from a team as a code owner April 4, 2025 22:06
NicolasMassart
NicolasMassart previously approved these changes Apr 7, 2025

@NicolasMassart NicolasMassart left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excelent PR!
I love these new matchers!

Comment thread app/util/test/testSetup.js Outdated
Comment thread app/util/test/testSetup.js
Co-authored-by: Nico MASSART <NicolasMassart@users.noreply.github.com>
@github-actions

github-actions Bot commented Apr 7, 2025

Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 5fc0621
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/9d58d87c-6ae0-4409-ad13-9c78744d35db

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@github-actions

github-actions Bot commented Apr 7, 2025

Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 4845d5a
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/2d91d210-50bf-4486-af89-d2287d11b35f

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@sonarqubecloud

sonarqubecloud Bot commented Apr 7, 2025

Copy link
Copy Markdown

@Cal-L Cal-L left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Prithpal-Sooriya Prithpal-Sooriya added this pull request to the merge queue Apr 7, 2025
Merged via the queue into main with commit 723f57b Apr 7, 2025
@Prithpal-Sooriya Prithpal-Sooriya deleted the upgrade-testing-library-react-native branch April 7, 2025 19:35
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 7, 2025
@metamaskbot metamaskbot added the release-7.45.0 Issue or pull request that will be included in release 7.45.0 label Apr 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.45.0 Issue or pull request that will be included in release 7.45.0 team-assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants