-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
[in_app_purchase_storekit] Migrate InAppPurchasePluginTests.m to. Swift #7105
Conversation
…es into iap-tests-methodchannel
@@ -1,3 1,7 @@ | |||
## 0.3.17 1 | |||
|
|||
* Convert main plugin tests to swift. |
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.
Converts
@@ -22,15 22,10 @@ public class InAppPurchasePlugin: NSObject, FlutterPlugin, InAppPurchaseAPI { | |||
// TODO(louisehsu): Change it back to a set when removing obj-c dependancies from this file via type erasure | |||
private var requestHandlers = NSHashTable<FLTRequestHandlerProtocol>() | |||
private var handlerFactory: ((SKRequest) -> FLTRequestHandlerProtocol) | |||
// TODO(louisehsu): Once tests are migrated to swift, we can use @testable import, and make theses vars private again and remove all instances of @objc | |||
@objc |
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.
Nice!
name: "plugins.flutter.io/in_app_purchase", | ||
binaryMessenger: messenger) | ||
) | ||
setupTransactionObserverChannel(withMessenger: messenger) |
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.
nit: setupTransactionObserverChannelIfNeeded
func testCanMakePayments() { | ||
var error: FlutterError? | ||
let result = plugin.canMakePaymentsWithError(&error) | ||
XCTAssertTrue(result!.boolValue) |
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.
Nit: Try to avoid !
Can you look at XCTUnwrap
: https://www.hackingwithswift.com/example-code/testing/how-to-check-and-unwrap-optionals-in-tests-using-xctunwrap
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.
oho I did not know about, thats super helpful
auto label is removed for flutter/packages/7105, due to - The status or check suite Mac_arm64 macos_repo_checks has failed. Please fix the issues identified (or deflake) before re-applying this label. |
flutter/packages@d03b1b4...c7f0526 2024-07-18 737941 [email protected] [flutter_plugin_tools] Allow disabling Swift Package Manager when building examples (flutter/packages#7145) 2024-07-17 [email protected] Modernize all `index.html` files to support WASM (flutter/packages#7114) 2024-07-17 [email protected] [in_app_purchase_storekit] Migrate InAppPurchasePluginTests.m to. Swift (flutter/packages#7105) 2024-07-17 [email protected] [ci] Drive tests with html renderer if CHANNEL is stable. (flutter/packages#7146) 2024-07-17 49699333 dependabot[bot]@users.noreply.github.com [in_app_pur]: Bump com.android.tools.build:gradle from 7.3.1 to 8.5.1 in /packages/in_app_purchase/in_app_purchase_android/android (flutter/packages#7120) 2024-07-17 49699333 dependabot[bot]@users.noreply.github.com [image_picker]: Bump com.android.tools.build:gradle from 7.2.1 to 8.5.1 in /packages/image_picker/image_picker_android/android (flutter/packages#7121) 2024-07-17 49699333 dependabot[bot]@users.noreply.github.com [url_launcher]: Bump com.android.tools.build:gradle from 7.3.0 to 8.5.1 in /packages/url_launcher/url_launcher_android/android (flutter/packages#7128) 2024-07-17 30872003 [email protected] [camera_avfoundation] do not append sample buffer when readyForMoreMediaData is NO to avoid crash (flutter/packages#6901) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/ doc/main/autoroll/README.md
Part of flutter/flutter#151624
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the [pub versioning philosophy], or this PR is [exempt from version changes].CHANGELOG.md
to add a description of the change, [following repository CHANGELOG style], or this PR is [exempt from CHANGELOG changes].///
).