Skip to content

Commit

Permalink
IntegrationTests: actually fail test if tests aren't configured
Browse files Browse the repository at this point in the history
Looks like calling `XCTFail` followed by throwing an error was making the test continue for some reason, which was then making it crash instead because `Purchases.shared` isn't set.
By removing the `XCTFail`, `XCTest` now correctly sees this as a test failure and doesn't run the tests.

See also RevenueCat/purchases-hybrid-common#210
  • Loading branch information
NachoSoto committed Aug 19, 2022
1 parent 2099e2e commit 16898b4
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ class BaseBackendIntegrationTests: XCTestCase {
self.continueAfterFailure = false

guard Constants.apiKey != "REVENUECAT_API_KEY", Constants.proxyURL != "REVENUECAT_PROXY_URL" else {
XCTFail("Must set configuration in `Constants.swift`")
throw ErrorCode.configurationError
throw ErrorUtils.configurationError(message: "Must set configuration in `Constants.swift`")
}

userDefaults = UserDefaults(suiteName: Constants.userDefaultsSuiteName)
Expand Down

0 comments on commit 16898b4

Please sign in to comment.