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 react-native-contacts type definitions for v5.x.x #4045

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

katieisnell
Copy link

  • Links to documentation:
  • Link to GitHub or NPM:
  • Type of contribution: new definition

Other notes:
I struggled to write tests for the library react-native-contacts, so please can someone help me to understand how to do this?

@Brianzchen
Copy link
Member

@katieisnell for testing, follow some of the examples in the project. Maybe this one for app-root-path that I did recently.
https://github.com/flow-typed/flow-typed/blob/master/definitions/npm/app-root-path_v3.x.x/flow_v0.142.x-/test_app-root-path_v3.x.x.js

Group your tests in describe/it blocks and then write tests that validate your library definitions so that if someone were to accidentally change it to something unexpected it would fail. Remember you are testing just the definitions not the library itself so test if you can use a function in a particular way you expect.

Also don't forget to add some cases you expect to fail and then use suppression codes to validate they fail as expected, this will be helpful if you want to check that function A definitely returns void or something.

Once you've written some tests you can run it with ./quick_run_def_tests.sh if you are on linux/macos or quick_run_def_tests.cmd if you are on windows.

@gantoine gantoine added the changes requested Changes have been requested by a reviewer label May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes requested Changes have been requested by a reviewer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants