-
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
Closed
fullofcaffeine
wants to merge
15
commits into
trunk
from
update/etk-wordpress-interface-to-latest-version
Closed
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
c11b40c
Update ``@wordpress/interface` to the latest published version
fullofcaffeine 3f26ef9
Dedupe NPM packages
fullofcaffeine 6335888
Silence peerDependency not satisfied warning for @wordpress/interface
fullofcaffeine 4e130bd
Override `@wordpress/element` subpackages to 4.2.0 for storybook to c…
fullofcaffeine 8f5d8f8
Fix test that failed due to `Date.now` being `undefined`
fullofcaffeine a9d298c
Cleanup .yarnrc.yml
fullofcaffeine 7317b4a
Dedupe
fullofcaffeine b090bcf
Reinstall/update `@wordpress/interface` without deduping
fullofcaffeine 55213d0
Revert yarn.lock
fullofcaffeine 8a0490f
Merge branch 'trunk' into update/etk-wordpress-interface-to-latest-ve…
fullofcaffeine 3ec8d39
Reinstall packages after rebase
fullofcaffeine 42fd038
Try with more strict @wordpress dependencies
tyxla 44249e1
Bump some obsolete package versions
tyxla a11fc56
Revert "Bump some obsolete package versions"
tyxla 3a6e031
Revert "Try with more strict @wordpress dependencies"
tyxla File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.