-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
Add tests for utility functions of library #23903
Conversation
|
@gandreadis these types of PRs are loved! |
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.
LGTM
Thanks! I have no idea why that one CircleCI build is failing, possibly a flaky test? If so, could someone with the right permissions rerun that check? It does not seem to be related to my changes, in any case. |
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.
Thank you for adding tests!
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.
@cpojer is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@gandreadis These types of PRs are extremely appreciated, thank you!! Please keep sending them :) |
This pull request was successfully merged by @gandreadis in 47e0615. When will my fix make it into a release? | Upcoming Releases |
Summary: This PR add tests for several utilities in `Libraries/Utilities`, as a follow-up of #23903. The following utilities are now tested: * `clamp.js` * `binareToBase64.js` * `DeviceInfo.js` * `mergeIntoFast.js` * `PixelRatio.js` * `infoLog.js` * `logError.js` * `warnOnce.js` * `mapWithSeparator` (added a missing test) Not applicable, since it only adds tests. Pull Request resolved: #23989 Differential Revision: D14502806 Pulled By: cpojer fbshipit-source-id: e2c3b3a35f4f765d5336b998ab92dba14eeac7bc
Summary: This PR adds a number of unit tests for the Geolocation module, as a follow-up of #23903. I also added two missing documentation strings to that module, with references to the online documentation, for consistency with the other methods in the same module. Not applicable, since it only adds tests. Pull Request resolved: #23987 Differential Revision: D14502848 Pulled By: cpojer fbshipit-source-id: 8f7c1cee6be3fae081d9770e5e942fadda65e6c2
Summary
I was looking at the coverage report of the JavaScript code in the
Libraries
folder, and found some of the modules and functions to be (partially) untested. I believe that adding tests to them would formally capture their behaviour and avoid future regressions. In this PR, I've added some unit tests for 3 utility components.Perhaps a more general question: Are these kinds of PRs appreciated? I'd be interested in submitting more of them in the future.
Changelog
Not applicable, since it only adds tests.
Test Plan
This is a testing PR, so I do not believe that is necessary :)