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

Wire up ability to write iOS unit tests #761

Merged
merged 3 commits into from
Jul 23, 2024
Merged

Wire up ability to write iOS unit tests #761

merged 3 commits into from
Jul 23, 2024

Conversation

bric-stripe
Copy link
Collaborator

Summary

Followed along with how stripe-react-native has things setup.

  • The .podspec specifies the tests and excludes them from the main sources
  • The Podfile sets up a test target
  • Create a new UnitTests scheme in the xcworkspace that builds and tests from the new target
  • import the stripe_terminal_react_native as a @testable import... so the classes are exposed
  • write tests

I wrote a very simple, not very useful, test on the location status mapper as an example.

Motivation

tests!

Testing

CI

  • I tested this manually
  • I added automated tests

Documentation

Select one:

  • I have added relevant documentation for my changes.
  • This PR does not result in any developer-facing changes.

not entirely sure what these were from but makes it a bit awkward to work in so proposing to rm assuming CI passes
took me a bit but made sense of how stripe-react-native is doing things and followed along. This sets up a mapperstests. The one test can be run from command line with

xcodebuild test -workspace dev-app/ios/StripeTerminalReactNativeDevApp.xcworkspace -destination 'platform=iOS Simulator,name=iPhone 15' -scheme UnitTests

but its not a worthwhile test but should unblock folks to add more.
@bric-stripe bric-stripe merged commit 3f01bce into main Jul 23, 2024
3 checks passed
@bric-stripe bric-stripe deleted the bric/swift-tests branch July 23, 2024 00:05
nazli-stripe pushed a commit that referenced this pull request Sep 11, 2024
* rm missing references from the xcproj

not entirely sure what these were from but makes it a bit awkward to work in so proposing to rm assuming CI passes

* Stubbed runnable test

took me a bit but made sense of how stripe-react-native is doing things and followed along. This sets up a mapperstests. The one test can be run from command line with

xcodebuild test -workspace dev-app/ios/StripeTerminalReactNativeDevApp.xcworkspace -destination 'platform=iOS Simulator,name=iPhone 15' -scheme UnitTests

but its not a worthwhile test but should unblock folks to add more.

* Attempt to wire up to bitrise
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.

2 participants