Skip to content

Commit 9a41f38

Browse files
Add check for app already configured
1 parent aa69f88 commit 9a41f38

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Tests/Unit/InstanceTests.swift

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,15 @@ class InstanceTests: XCTestCase {
5252
)
5353

5454
override class func setUp() {
55-
FirebaseApp.configure(options: options)
56-
defaultApp = FirebaseApp.app()
57-
58-
FirebaseApp.configure(name: "app-two", options: optionsTwo)
59-
appTwo = FirebaseApp.app(name: "app-two")
55+
if defaultApp == nil {
56+
FirebaseApp.configure(options: options)
57+
defaultApp = FirebaseApp.app()
58+
}
59+
60+
if appTwo == nil {
61+
FirebaseApp.configure(name: "app-two", options: optionsTwo)
62+
appTwo = FirebaseApp.app(name: "app-two")
63+
}
6064
}
6165

6266
// same connector config, same app, instance returned should be same

0 commit comments

Comments
 (0)