-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[ETK] Update @wordpress/interface
to the latest published version
#73629
Changes from 7 commits
c11b40c
3f26ef9
6335888
4e130bd
8f5d8f8
a9d298c
7317b4a
b090bcf
55213d0
8a0490f
3ec8d39
42fd038
44249e1
a11fc56
3a6e031
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -300,7 +300,9 @@ | |
"newspack-components/@wordpress/element": "4.7.0", | ||
"newspack-components/@wordpress/i18n": "4.9.0", | ||
"keytar@npm:7.7.0/node-addon-api": "3.1.0", | ||
"lzma-native": "^8.0.5" | ||
"lzma-native": "^8.0.5", | ||
"@wordpress/primitives/@wordpress/element": "4.20.0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we pin this to a particular version of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point 👍🏻 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, after resetting the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I removed those entries. |
||
"@wordpress/icons@npm:9.18.0/@wordpress/element": "4.20.0" | ||
}, | ||
"packageManager": "yarn@3.2.3", | ||
"dependenciesMeta": { | ||
|
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.
These tests were failing with:
I haven't dug too deep, but looks like this is caused by the
requestidlecallback
package, which now usesDate.now
. Before the package updates that are part of this PR,Date.now
was not in any of the code paths for this test (apparently), so something changed after the update.With the
mockedImplementation
approach, it discardedDate
's original implementation to only define the customgetTimezoneOffset
. I've tried to usespyOn
+mockImplementation
to return a custom class based offDate
but failed - it was much simpler to just override the global variable and re-assign the original object to it in theafterAll
callback.I wonder why this test triggered a portion of code that uses this package now while it didn't before the update. Maybe that package was already used, and it was recently updated to use
Date.now
. Provided tests pass, I think it's okay to consider this relatively safe to ship, but if you have more insights, let me know. Besides, in the case of globals likeDate
, I think it's safer to keep the original implementation accessible and mock the functions over it. The previous approach based onmockImplementation
removed all other functions and properties (including the staticnow
).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.
No concerns from my side about this change. We've seen similar issues in Gutenberg tests too. It's usually that something tries to access
Date
before thejsdom
mock has been setup, or something inadvertently overrides it for the test.