mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Added custom enviroment flags for unit and UI tests.
This commit is contained in:
@@ -13,8 +13,33 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
private var appCoordinator: AppCoordinator!
|
||||
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
|
||||
if isRunningUnitTests {
|
||||
return true
|
||||
}
|
||||
|
||||
if isRunningUITests {
|
||||
// Bootstrap a different version of the application
|
||||
return true
|
||||
}
|
||||
|
||||
appCoordinator = AppCoordinator()
|
||||
appCoordinator.start()
|
||||
return true
|
||||
}
|
||||
|
||||
private var isRunningUnitTests: Bool {
|
||||
#if DEBUG
|
||||
ProcessInfo.processInfo.environment["IS_RUNNING_UNIT_TESTS"] == "1"
|
||||
#else
|
||||
false
|
||||
#endif
|
||||
}
|
||||
|
||||
private var isRunningUITests: Bool {
|
||||
#if DEBUG
|
||||
ProcessInfo.processInfo.environment["IS_RUNNING_UI_TESTS"] == "1"
|
||||
#else
|
||||
false
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user