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

[media-library] Add unit tests to module #9538

Merged
merged 11 commits into from Aug 5, 2020

Conversation

barthap
Copy link
Contributor

@barthap barthap commented Aug 4, 2020

Why

MediaLibrary has many utility methods, which behavior is sometimes unclear. Unit tests would describe that behavior.

Also, contains some minor fixes.

How

  • Add native unit tests to MediaLibrary on Android.
  • Fixes bug, where getAssetsAsync() could return without promise rejection, when caught IOException
  • Adds a little input validation to module methods
  • Removes unused test dependencies from expo-web-browser.

Test plan

et android-native-unit-tests


WIP

  • Add testing dependencies
  • Add utility functions to mock ContentResolver
  • Test GetQueryInfo
  • Test MediaLibraryUtils where possible
  • Test GetAssets
  • Test GetAssetInfo
  • Extract useful test utility functions to unimodules-test-core
  • Input validation and minor refactors

@barthap barthap requested a review from lukmccall August 4, 2020 05:56
@github-actions
Copy link
Contributor

github-actions bot commented Aug 4, 2020

Native Component List for this branch is ready

@barthap barthap requested a review from bbarthec August 4, 2020 10:47
@barthap barthap marked this pull request as ready for review August 4, 2020 13:27
Copy link
Contributor

@lukmccall lukmccall left a comment

Choose a reason for hiding this comment

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

LGTM 💪

Copy link
Contributor

@bbarthec bbarthec left a comment

Choose a reason for hiding this comment

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

LGTM 👍

barthap and others added 2 commits August 5, 2020 10:50
Co-authored-by: Łukasz Kosmaty <lukasz.kosmaty@swmansion.com>
@lukmccall lukmccall merged commit c6f3677 into master Aug 5, 2020
@lukmccall lukmccall deleted the @barthap/media-library/unit-tests branch August 5, 2020 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants