Skip to content

Commit 77a7a86

Browse files
test: update setup logic
1 parent 8a09f9a commit 77a7a86

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

samples/swiftui/FirebaseSwiftUIExample/FirebaseSwiftUIExampleTests/FirebaseSwiftUIExampleTests.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ let kPassword = "123456"
1515

1616
struct FirebaseSwiftUIExampleTests {
1717
@MainActor
18-
func prepareFreshAuthService() async throws -> AuthService {
18+
func prepareFreshAuthService(configuration: AuthConfiguration? = nil) async throws
19+
-> AuthService {
1920
configureFirebaseIfNeeded()
2021
try await clearAuthEmulatorState()
2122

22-
let auth = Auth.auth()
23-
return AuthService(auth: auth)
23+
let resolvedConfiguration = configuration ?? AuthConfiguration()
24+
25+
return AuthService(configuration: resolvedConfiguration)
2426
}
2527

2628
@Test

samples/swiftui/FirebaseSwiftUIExample/FirebaseSwiftUIExampleTests/TestHarness.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ func configureFirebaseIfNeeded() {
1515
if FirebaseApp.app() == nil {
1616
FirebaseApp.configure()
1717
}
18-
Auth.auth().useEmulator(withHost: "localhost", port: 9099)
1918
}
2019

2120
private var hasCheckedEmulatorAvailability = false
@@ -42,6 +41,7 @@ func isEmulatorRunning() async throws {
4241
]
4342
)
4443
}
44+
Auth.auth().useEmulator(withHost: "localhost", port: 9099)
4545
hasCheckedEmulatorAvailability = true
4646
}
4747

0 commit comments

Comments
 (0)