Skip to content

resolve test flake on evaluateJavascript#249

Open
kiftio wants to merge 1 commit into
mainfrom
fix-test-flake-via-closure
Open

resolve test flake on evaluateJavascript#249
kiftio wants to merge 1 commit into
mainfrom
fix-test-flake-via-closure

Conversation

@kiftio
Copy link
Copy Markdown
Contributor

@kiftio kiftio commented Jun 2, 2026

What changes are you making?

Fixed flakiness by removing the async wait

The issue was the test observed WKWebView.evaluateJavaScript through a mock override and XCTest expectation, which made the assertion depend on WebKit scheduling.

Added an internal closure-backed overload in CheckoutBridge.swift, kept the real WKWebView call path unchanged, and updated CheckoutBridgeTests.swift to assert the generated JavaScript synchronously.

The now-unused MockWebView.swift was deleted.

How to test

dev swift test CheckoutBridgeTests

Before you merge

Important

  • I've added tests to support my implementation
  • I have read and agree with the Contribution Guidelines
  • I have read and agree with the Code of Conduct
  • I've updated the relevant platform README (platforms/swift/README.md and/or platforms/android/README.md)

Releasing a new Swift version?
  • I have bumped the version in ShopifyCheckoutKit.podspec
  • I have bumped the version in platforms/swift/Sources/ShopifyCheckoutKit/ShopifyCheckoutKit.swift
  • I have updated platforms/swift/CHANGELOG.md
  • I have updated the SwiftPM/CocoaPods version snippets in platforms/swift/README.md (major version only)
Releasing a new Android version?
  • I have bumped the versionName in platforms/android/lib/build.gradle
  • I have updated platforms/android/CHANGELOG.md
  • I have updated the Gradle/Maven version snippets in platforms/android/README.md

Tip

See the Contributing documentation for the full release process per platform.

@kiftio kiftio requested a review from a team as a code owner June 2, 2026 16:17
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

React Native — Coverage Report

Lines Statements Branches Functions
Coverage: 92%
91.59% (316/345) 87.25% (178/204) 100% (82/82)

Copy link
Copy Markdown
Contributor

@Juanita-Dash Juanita-Dash left a comment

Choose a reason for hiding this comment

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

LGTM

@Juanita-Dash Juanita-Dash requested a review from a team June 2, 2026 19:12
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.

4 participants