Add testModeBehavior option to SuperwallOptions#437
Merged
yusuftor merged 6 commits intofeature/test-storefrom Feb 18, 2026
Merged
Add testModeBehavior option to SuperwallOptions#437yusuftor merged 6 commits intofeature/test-storefrom
yusuftor merged 6 commits intofeature/test-storefrom
Conversation
Adds a new `debugModeBehavior` property to `SuperwallOptions` that gives developers explicit control over when test mode activates: - `.automatic` (default): activates on dashboard match or bundle ID mismatch, but never during UI tests - `.whenEnabledForUser`: only activates on dashboard user match - `.never`: test mode is never activated - `.always`: test mode is always activated Also forces `shouldBypassAppTransactionCheck = true` in UI test environments so StoreKit checks don't block test runners. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… detection - Rename DebugModeBehavior -> TestModeBehavior, debugModeBehavior -> testModeBehavior - Rename SWKDebugModeBehavior -> SWKTestModeBehavior (ObjC) - Rename debugOption -> testModeOption - Rename isUITestEnvironment -> isTestEnvironment - Skip test mode in test environments unless SUPERWALL_UNIT_TESTS launch arg is set - Update tests to work correctly with the new environment detection Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use where clause instead of if inside for loop - Remove superfluous swiftlint disable commands - Remove extra blank line before closing brace Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TestModeBehaviorenum andtestModeBehaviorproperty toSuperwallOptions, giving developers explicit control over when test mode activates (.automatic,.whenEnabledForUser,.never,.always)TestModeManager.evaluateTestModeto respect the new option, extractingcheckConfigMatchandcheckBundleIdMismatchhelpersshouldBypassAppTransactionCheck = truein test environments so StoreKit checks don't block test runnersDebugModeBehavior→TestModeBehavior,debugModeBehavior→testModeBehavior,SWKDebugModeBehavior→SWKTestModeBehaviorfor consistencydebugOption→testModeOptionandisUITestEnvironment→isTestEnvironmentisTestEnvironmentdetects all test runners viaNSClassFromString("XCTestCase")but bypasses detection whenSUPERWALL_UNIT_TESTSlaunch argument is present, allowing internal unit tests to exercise the.automaticpathTestModePurchaseDrawerand replaces hardcoded colors with semantic UIKit colors for dark mode supportTestModeBehaviorcasesTest plan
.automatic(default) behavior matches existing behavior for dashboard-enabled users and bundle ID mismatches.automaticskips test mode activation when running in external test environments (noSUPERWALL_UNIT_TESTSarg).whenEnabledForUseronly activates on dashboard user match, ignoring bundle ID mismatch.neverprevents test mode from activating even with matching config.alwaysenables test mode regardless of configshouldBypassAppTransactionCheckis forcedtruein test environmentsTestModePurchaseDrawerin both light and dark modes🤖 Generated with Claude Code