Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add @expo/entity-testing-utils package #280

Merged

Conversation

wschurman
Copy link
Member

@wschurman wschurman commented Apr 7, 2025

Why

When testing the last batch of changes in the Expo server, I noticed that I needed to use the TSMockitoExtensions. Figured it was a good idea to expose them for others to use as well.

How

The challenge is that these should only be in dev dependencies so exposing them in the @expo/entity package is a no-go.

So, create a new package. Then, it made sense to move all the testing utilities to that package. But this requires duplicating code since it would create a dependency cycle if entity used the common code in addition to the common code using entity. So, the solution is to make the test utils depend on entity but not vice-versa and just duplicate the modules. Then, add a test to ensure the duplicated modules stay perfectly in-sync.

This also moves the other test utilities into this new package.

Test Plan

Run all tests (full coverage).

Copy link
Member Author

wschurman commented Apr 7, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

codecov bot commented Apr 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.68%. Comparing base (1da5cc0) to head (adf1c53).
Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##              main     #280      +/-   ##
===========================================
- Coverage   100.00%   99.68%   -0.32%     
===========================================
  Files           88       81       -7     
  Lines         2417     2192     -225     
  Branches       285      241      -44     
===========================================
- Hits          2417     2185     -232     
- Misses           0        7       +7     
Flag Coverage Δ
integration 99.68% <ø> (-0.32%) ⬇️
unittest 99.68% <ø> (-0.32%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@wschurman wschurman force-pushed the @wschurman/04-07-feat_add_expo/entity-testing-utils_package branch 2 times, most recently from b64fd88 to 98eef2d Compare April 7, 2025 22:28
@wschurman wschurman force-pushed the @wschurman/04-07-feat_add_expo/entity-testing-utils_package branch from 98eef2d to adf1c53 Compare April 7, 2025 22:33
@wschurman wschurman marked this pull request as ready for review April 7, 2025 22:46
@wschurman wschurman requested review from quinlanj and sjchmiela April 7, 2025 22:47
Copy link
Member Author

wschurman commented Apr 9, 2025

Merge activity

  • Apr 9, 12:11 PM EDT: A user started a stack merge that includes this pull request via Graphite.
  • Apr 9, 12:11 PM EDT: A user merged this pull request with Graphite.

@wschurman wschurman merged commit 485894a into main Apr 9, 2025
3 of 4 checks passed
@wschurman wschurman deleted the @wschurman/04-07-feat_add_expo/entity-testing-utils_package branch April 9, 2025 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants