Skip to content
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

Closed
wants to merge 4 commits into from

Conversation

gandreadis
Copy link

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 :)

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 13, 2019
@pull-bot
Copy link

Messages
📖

📋 Changelog Format - Did you include a Changelog? A changelog entry has the following format: [CATEGORY] [TYPE] - Message.

Generated by 🚫 dangerJS against fbf400a

@ericlewis
Copy link
Contributor

@gandreadis these types of PRs are loved!

Copy link
Contributor

@ericlewis ericlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gandreadis
Copy link
Author

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.

Copy link
Contributor

@cpojer cpojer left a 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!

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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.

@cpojer
Copy link
Contributor

cpojer commented Mar 15, 2019

@gandreadis These types of PRs are extremely appreciated, thank you!! Please keep sending them :)

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @gandreadis in 47e0615.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label Mar 15, 2019
facebook-github-bot pushed a commit that referenced this pull request Mar 18, 2019
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
facebook-github-bot pushed a commit that referenced this pull request Mar 18, 2019
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants