-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
ref(tests): Rename disableRouterMocks to enableRouterMocks #88513
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #88513 +/- ##
==========================================
+ Coverage 87.74% 87.76% +0.01%
==========================================
Files 10014 10010 -4
Lines 567528 566789 -739
Branches 22298 22283 -15
==========================================
- Hits 498000 497414 -586
+ Misses 69111 68956 -155
- Partials 417 419 +2 |
138100d
to
10ee5ce
Compare
10ee5ce
to
e2ac6bf
Compare
@@ -137,6 +138,7 @@ function patchBrowserHistoryMocksEnabled(history: MemoryHistory, router: Injecte | |||
} | |||
|
|||
function makeAllTheProviders(options: ProviderOptions) { | |||
const enableRouterMocks = options.enableRouterMocks ?? true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default to true
looks correct in all the places inside reactTestingLibrary.tsx
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
In preparation for making the new test routing the default behavior, I'm inverting `disableRouterMocks`. This will make the ergonomics slightly better, where toggling on the legacy behavior will be done with `enableRouterMocks: true`, and `enableRouterMocks` will be deprecated. For now this inverts all the existing usages, but does not change the default behavior. The next step will be to add `enableRouterMocks: true` for all other tests and change the default to use the new routing.
Ref https://github.com/getsentry/frontend-tsc/issues/85
In preparation for making the new test routing the default behavior, I'm inverting
disableRouterMocks
. This will make the ergonomics slightly better, where toggling on the legacy behavior will be done withenableRouterMocks: true
, andenableRouterMocks
will be deprecated.For now this inverts all the existing usages, but does not change the default behavior. The next step will be to add
enableRouterMocks: true
for all other tests and change the default to use the new routing.