-
Notifications
You must be signed in to change notification settings - Fork 142
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
🐛 Allow both history and History prototype to be patched by 3rd party #2968
Conversation
} | ||
|
||
registerCleanupTask(() => { | ||
// @ts-expect-error reseting history instance to its original state |
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.
Suggestion: Because we don't mock the location anymore in mockLocation
, maybe rename this file. (Don't put buildLocation
into testSetupBuilder.ts
as it will conflict with #2952)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2968 +/- ##
=======================================
Coverage 93.49% 93.50%
=======================================
Files 271 271
Lines 7640 7631 -9
Branches 1703 1704 +1
=======================================
- Hits 7143 7135 -8
+ Misses 497 496 -1 ☔ View full report in Codecov by Sentry. |
Bundles Sizes Evolution
🚀 CPU Performance
🧠 Memory Performance
|
/to-staging |
🚂 Branch Integration: starting soon, median merge time is 8m Commit 1040139db3 will soon be integrated into staging-36. Use |
Integrated commit sha: 1040139 Co-authored-by: Thomas Lebeau <thomas.lebeau@datadoghq.com>
🚂 Branch Integration: This commit was successfully integrated Commit 1040139db3 has been merged into staging-36 in merge commit 37b8d9ecb6. Check out the triggered pipeline on Gitlab 🦊 |
Motivation
Since #2944, we broke the instrumentation for NextJs that is patching
history.pushState
instead ofHistory.prototype.pushState
. This PR allow both way to be patched (even if incorrect)Changes
history.pushState
if it is already patched that way, otherwise wrapHistory.prototype.pushState
spyOn
is effectively the same as wrapping so this make testing difficult.Testing
I've added unit test, to cover both #2956 and #2943
I have gone over the contributing documentation.