-
Notifications
You must be signed in to change notification settings - Fork 4.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
Testing: Add missing unit tests to packages #13812
Comments
I'd be happy to look at some of these! I've never used jest before 😍 I'm working on writing a test for
|
Is that necessary to verify internals through mocking library? I think |
Well, that would work. But then the test does not strictly test the functionality of What's the likelihood of |
Those methods aren't pure and therefore are hard to test. I wouldn't spend too much time on it. Very basic verification is fine as this is a tiny wrapper over URL API. |
👍 okie doke! I'll get a few tests in for |
I think this is related: https://stackoverflow.com/a/52969731 and jestjs/jest#7645; thinking of some possible solutions. In a nutshell: jest ships with |
Thanks for the list @gziolo Ill take a stab at the keycodes test case first. |
I don't see any movement on this issue. Let's close this one and work on adding more unit tests as we update the functionality rather than independently from production changes. |
Raised by @georgestephanis on WordPress.org Slack (link requires registration at https://make.wordpress.org/chat/):
https://wordpress.slack.com/archives/C02QB2JS7/p1549826915372300
There is no list like this. There used to be a similar task in the past but we closed it as it became very outdated. I can't find the link at the moment.
This is going to be a living document where we should collectively collect all API methods that are exposed in WordPress packages but aren't unit tested. I would prefer to skip UI components in this issue as they are usually harder to cover with tests.
Please make sure to comment on the issue if you plan to work on adding unit tests. Remember about sharing all details of the work planned to avoid duplication of efforts. Thanks!
@wordpress/autop
removep
(more details in autop: Include tests forremovep
functionality #15152)@wordpress/blob
createBlobURL
getBlobByURL
revokeBlobURL
@wordpress/compose
ifCondition
(complex)withSafeTimeout
(complex)@wordpress/date
format
(complex)@wordpress/dom
computeCaretRect
documentHasSelection
getOffsetParent
getScrollContainer
getRectangleFromRange
isEntirelySelected
isVerticalEdge
placeCaretAtVerticalEdge
tabbable.isTabbableIndex
@wordpress/keycodes
isKeyboardEvent
(Added testcases for isKeyboardEvent in keycodes module #14073)@wordpress/priority-queue
createQueue
(complex++)The text was updated successfully, but these errors were encountered: