You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Works in unit testing and when configured for e2e testing,
except for the expected test failures on disabled users, OOB and SMS
codes as the test suite needs a port to work against an empty auth
emulator vs the pre-configured data in the cloud
Prior art doing the auth tests is noted, but needs a port to javascript
Copy file name to clipboardExpand all lines: packages/firebase_auth/firebase_auth/android/src/main/java/io/flutter/plugins/firebase/auth/Constants.java
Copy file name to clipboardExpand all lines: packages/firebase_auth/firebase_auth/android/src/main/java/io/flutter/plugins/firebase/auth/FlutterFirebaseAuthPlugin.java
Copy file name to clipboardExpand all lines: packages/firebase_auth/firebase_auth/example/test_driver/firebase_auth_e2e.dart
+8
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,7 @@
5
5
// BSD-style license that can be found in the LICENSE file.
6
6
7
7
import'package:drive/drive.dart'as drive;
8
+
//import 'package:firebase_auth/firebase_auth.dart'; // only needed if you use the Auth Emulator
8
9
import'package:firebase_core/firebase_core.dart';
9
10
import'package:flutter_test/flutter_test.dart';
10
11
@@ -17,6 +18,13 @@ bool USE_EMULATOR = false;
17
18
voidtestsMain() {
18
19
setUpAll(() async {
19
20
awaitFirebase.initializeApp();
21
+
22
+
// Configure the Auth test suite to use the Auth Emulator
23
+
// This may not be enabled until the test suite is ported to:
24
+
// - have ability to create disabled users
25
+
// - have ability to fetch OOB and SMS verification codes
26
+
// JS implementation to port to dart here: https://github.com/invertase/react-native-firebase/pull/4552/commits/4c688413cb6516ecfdbd4ea325103d0d8d8d84a8#diff-44ccd5fb03b0d9e447820032866f2494c5a400a52873f0f65518d06aedafe302
Copy file name to clipboardExpand all lines: packages/firebase_auth/firebase_auth_platform_interface/lib/src/method_channel/method_channel_firebase_auth.dart
+13
Original file line number
Diff line number
Diff line change
@@ -255,6 +255,19 @@ class MethodChannelFirebaseAuth extends FirebaseAuthPlatform {
255
255
returnthis;
256
256
}
257
257
258
+
@override
259
+
Future<void> useEmulator(String host, int port) async {
Copy file name to clipboardExpand all lines: packages/firebase_auth/firebase_auth_platform_interface/lib/src/platform_interface/platform_interface_firebase_auth.dart
+11
Original file line number
Diff line number
Diff line change
@@ -115,6 +115,17 @@ abstract class FirebaseAuthPlatform extends PlatformInterface {
115
115
throwUnimplementedError("sendAuthChangesEvent() is not implemented");
116
116
}
117
117
118
+
/// Changes this instance to point to an Auth emulator running locally.
119
+
///
120
+
/// Set the [host] and [port] of the local emulator, such as "http://localhost"
121
+
/// with port 9099
122
+
///
123
+
/// Note: Must be called immediately, prior to accessing auth methods.
124
+
/// Do not use with production credentials as emulator traffic is not encrypted.
125
+
Future<void> useEmulator(String host, int port) {
126
+
throwUnimplementedError("useEmulator() is not implemented");
127
+
}
128
+
118
129
/// Applies a verification code sent to the user by email or other out-of-band
Copy file name to clipboardExpand all lines: packages/firebase_auth/firebase_auth_platform_interface/test/method_channel_tests/method_channel_firebase_auth_test.dart
Copy file name to clipboardExpand all lines: packages/firebase_auth/firebase_auth_platform_interface/test/platform_interface_tests/platform_interface_auth_test.dart
+10
Original file line number
Diff line number
Diff line change
@@ -401,6 +401,16 @@ void main() {
401
401
fail('Should have thrown an [UnimplementedError]');
0 commit comments