atn832 / firebase_auth_mocks Goto Github PK
View Code? Open in Web Editor NEWLicense: BSD 2-Clause "Simplified" License
License: BSD 2-Clause "Simplified" License
I have written several tests for my auth service and they all seemed to work fine until I needed to validate pre and post login actions.
The test failed. I narrowed it down to the fact that there is no callback on state change.
I had the authStateChange().listen (....) implemented so I tried to also implement userChanges().listen(...) but neither seems to be called.
AuthService({FirebaseAuth? mockFirebaseAuth}) {
if (mockFirebaseAuth != null) {
logg.i("AuthService -> Using mockFirebaseAuth");
_firebaseAuth = mockFirebaseAuth;
} else {
logg.w("AuthService -> Using real FirebaseAuth");
_firebaseAuth = FirebaseAuth.instanceFor(
app: Firebase.app(), persistence: Persistence.LOCAL);
registerAuthStateChangeListener();
_firebaseAuth.userChanges().listen((User? user) {
if (user == null) {
logg.i('Auth -> User is currently signed out!');
} else {
logg.i(
'Auth -> User is signed in as => ${isAnonymous ? "anonymous" : "non anonymous user with id=${user.uid}"}');
// assign the user id to crashlytics to be able to track errors by user
_onSignIn(user);
}
});
}
}
///
///
/// Main method to monitor sign in status change and
///
void registerAuthStateChangeListener() {
_firebaseAuth.authStateChanges().listen((User? user) {
if (user == null) {
log.i('Auth -> User is currently signed out!');
} else {
log.i(
'Auth -> User is signed in as => ${isAnonymous ? "anonymous" : "non anonymous user with id=${user.uid}"}');
// assign the user id to crashlytics to be able to track errors by user
_onSignIn(user);
}
});
}
This is how I try to use it:
group(
'Complex methods involving postponed executions dependent on login status',
() {
setUp(() => registerServices());
tearDown(() => locator.reset());
///
///
///
test('Postponed Execution', () async {
// ARRANGE
final mockCall = MockCall();
// ARRANGE
final FirebaseAuth mockFirebaseAuth;
mockFirebaseAuth = MockFirebaseAuth(mockUser: anonymousMockUser);
final authService = AuthService(mockFirebaseAuth: mockFirebaseAuth);
// VALIDATE - no call yet to postponed action on login
verifyNever(mockCall.call());
authService.onceSignedIn(() async {
mockCall.call();
});
await authService.signInAnonymously();
// delay to allow the callback to run
await Future.delayed(const Duration(milliseconds: 500));
expect(authService.currentUser, isNotNull);
expect(authService.signedIn, true);
expect(authService.isAnonymous, true);
//verify(mockCall.call()).called(1); //verify called once
});
});
}
class MockCall extends Mock {
void call();
}
I have validated that without postponing the call, everything works and passes the tests.
I looked at the source code of the package and it seems to be registering the sign in status callbacks... Am I doing something wrong?
Thank you!
Add support for mocking
sendSignInWithEmailLink({
required String email,
required ActionCodeSettings actionCodeSettings,
})
method
Because firebase_auth_mocks 0.1.3 depends on firebase_auth ^0.15.2 and no versions of firebase_auth_mocks match >0.1.3 <0.2.0, firebase_auth_mocks ^0.1.3 requires firebase_auth ^0.15.2.
By the way, many thanks for your the nice work. ๐
When creating a user with email and password via real FirebaseAuth the generated user has an entry in providerData having:
email: <the given email>
uid: <the given email>
providerId: password
It would be great if we could have a similar setup also in the mock implementation!
In my app I'm checking the length of the user password like this:
user.providerData.where((e) => e.providerId == "password").length
In my tests I can't find a solution on how to mock the user's providerData.
The 3.5.0 release of firebase_auth
changed the method signature of FirebaseAuth.verifyPhoneNumber
which results in a compile time error with firebase_auth_mocks
:
opt/homebrew/Caskroom/flutter/3.0.5/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth_mocks-0.8.4/lib/src/firebase_auth_mocks_base.dart:142:16: Error: The method 'MockFirebaseAuth.verifyPhoneNumber' has fewer named arguments than those of overridden method 'FirebaseAuth.verifyPhoneNumber'.
Future<void> verifyPhoneNumber({
^
/opt/homebrew/Caskroom/flutter/3.0.5/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-3.5.0/lib/src/firebase_auth.dart:716:16: Context: This is the overridden method ('verifyPhoneNumber').
Future<void> verifyPhoneNumber({
^
/opt/homebrew/Caskroom/flutter/3.0.5/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth_mocks-0.8.4/lib/src/firebase_auth_mocks_base.dart:142:16: Error: The method 'MockFirebaseAuth.verifyPhoneNumber' doesn't have the named parameter 'multiFactorInfo' of overridden method
'FirebaseAuth.verifyPhoneNumber'.
Future<void> verifyPhoneNumber({
^
/opt/homebrew/Caskroom/flutter/3.0.5/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-3.5.0/lib/src/firebase_auth.dart:716:16: Context: This is the overridden method ('verifyPhoneNumber').
Future<void> verifyPhoneNumber({
^
I'm not sure what's causing this, but when you run:
$ flutter pub add firebase_auth_mocks
as listed on pub.dev, it doesn't default to the latest version, that doesn't have the mockito dependency. Because of this I got a versioning conflict, but was able to remove the conflict by manually specifying firebase_auth_mocks: ^0.8.2
in the config.
Not sure if related to #46
Hi,
I am having a problem testing signInWithEmailAndPassword(), the AuthResult I get after running the test is null, I tried to run the exact example you gave but still getting the same error:
test('with email and password', () async {
final auth = MockFirebaseAuth();
final result = await auth.signInWithEmailAndPassword(
email: 'some email', password: 'some password');
final user = await result.user;
expect(user.uid, isNotEmpty);
expect(user.displayName, isNotEmpty);
});
the error I get is :
NoSuchMethodError: The getter 'user' was called on null.
Receiver: null
Tried calling: user
the result object is null and I really do not know why. I do not know if you faced this issu before, but I appreciate your help.
Thank you
I'm using FlutterFire's firebase_ui_auth, and MockFirebaseAuth throws an exception at https://github.com/firebase/flutterfire/blob/211fdbd8050170c3f29f301e4b5219c0bfdfbcb1/packages/firebase_ui_auth/lib/src/screens/internal/multi_provider_screen.dart#L45.
Hi there!
It is impossibile to throw an exception with reload method,
I read your code, in MockUser and in method reload() is missing _maybeThrowException(), for this reason it is impossible to test exception in reload method.
Currently, if I want to mock the method User.linkWithProvider
, which returns a UserCredential
, I have to implement my own mock for UserCredential.
I'd prefer to simply re-use your implementation so I can have something like the following:
when(() => firebaseAuth.currentUser!.linkWithProvider(any()))
.thenAnswer((_) async => Future.value(MockUserCredential(
mockUser: firebaseAuth.currentUser!,
));
Any reason why MockUserCredential
shouldn't be exported and made available?
Right now, getIdToken
and getIdTokenResult
return different pieces of information (for example the authentication and expiration dates are different). However they should be based on the same information.
Judging from the FirebaseAuth code, getIdToken and getIdTokenResult are based on the same data. So ideally [our] payload generation should be consolidated into a shared function.
Originally posted by @atn832 in #73 (comment)
I'm trying to mock a firestore call in a test with a mocked user but im getting:
NoSuchMethodError: Class 'MockUser' has no instance method 'reload' with matching arguments. Receiver: Instance of 'MockUser' Tried calling: reload() Found: reload() => Future<void>
the methods:
https://stackoverflow.com/questions/68411559/mocking-firebase-user-reload-in-flutter-test
Hi,
Gave it a go and got the following:
displayName: Bob,
uid: aabbcc.
Is this what I should expect?
If so can this info be put in the Readme.
Was using 'signInWithEmailPassword', was expecting that: user.email would return the email I enter but it returned 'null'
Thanks
Dimstein
In signOut, call stateChangedStreamController.add(null);
so that whoever listens to onAuthStateChanged
gets notified.
Is there a need for this? In my tests I check if there is a url and if not I don't make a network request. Now that there is a default url and it can't be null all my tests are broken as they are making network requests. Can we revert this behaviour and let mocks be specified with no url.
005ce64#diff-eb60b2d8b0185d5d8d7ee97f737473bc88bf572c21e3452e3d3cb28975631947R69
version conflict between firebase_auth_mocks and firebase_auth
need a new version of firebase_auth_mocks
Because every version of firebase_auth_mocks depends on firebase_auth ^0.14.0+5 and effy_app depends on firebase_auth ^0.15.2, firebase_auth_mocks is forbidden.
I wanted to create some widget and integration tests, which are basing on idTokenChanges method. Could you add it to MockFirebaseAuth?
HiGuy
0.8.1 is published to dart packages, but the pubspec in git is at 0.8.0. So the latest addition like userChanges
are not being included.
Of course one can override their local pubspec to point to git and this works. Just a pain
Instead of
expect(() async => await someFuture, returnsNormally);
and
expect(() async => await someFuture, returnsNormally);
We should be able to write:
expect(() => someFuture, completion);
or
expectLater(() => someFuture, returnsNormally);
and
expect(() => someFuture, throwsA(...));
https://api.flutter.dev/flutter/package-test_api_expect/expect.html
Certain matchers, like completion and throwsA, either match or fail asynchronously. When you use expect with these matchers, it ensures that the test doesn't complete until the matcher has either matched or failed. If you want to wait for the matcher to complete before continuing the test, you can call expectLater instead and await the result.
Originally posted by @atn832 in #68 (comment)
Please implement the userChanges stream.
I went ahead and forked this repo and implemented these two methods as would work for me. I feel that my User.delete
implementation commit is definitely worth pulling in (it is basically the same as a7737cd
), but I am unsure if my implementation of User.reauthenticateWithCredential
would break tests that others have written. I also went ahead and wrote tests around my implementations.
The fork can be found here. Let me know if there is anything you feel is worth making a PR for.
Hi! I could see that there is a function for signInWithPhoneNumber in the package but I'm not sure if its functional and how to use it. Any info regarding this function is appreciated.
Thanks!
This package should be migrated to null-safety
https://dart.dev/null-safety/migration-guide
Thank you for the great libraries. I really like the lightweight design that still gives good confidence on my implementation around Firestore.
While I tried to use the cloud_firestore_mocks, I found it does not work with FieldValue.serverTimestamp()
or FieldValue.delete()
.
https://gist.github.com/suztomo/729ace09a54a32649dc2265631363649
await subcollectionRef.document('foobar')
.setData(<String, dynamic>{
'content': 'MockFirestoreInstance is great',
'createdBy': 'Tomo',
'created': FieldValue.serverTimestamp(), // type 'MethodChannelFieldValue' is not a subtype of type 'MockFieldValuePlatform' in type cast
});
await subcollectionRef.document('foobar')
.setData(<String, dynamic>{
'content': FieldValue.delete() // type 'MethodChannelFieldValue' is not a subtype of type 'MockFieldValuePlatform' in type cast
});
FieldValue.serverTimestamp does not work:
โโโก EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
The following _CastError was thrown running a test:
type 'MethodChannelFieldValue' is not a subtype of type 'MockFieldValuePlatform' in type cast
When the exception was thrown, this was the stack:
#0 MockDocumentReference.updateData.<anonymous closure> (package:cloud_firestore_mocks/src/mock_document_reference.dart:34:74)
#1 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:379:8)
#2 MockDocumentReference.updateData (package:cloud_firestore_mocks/src/mock_document_reference.dart:32:10)
#3 MockDocumentReference.setData (package:cloud_firestore_mocks/src/mock_document_reference.dart:56:12)
#4 main.<anonymous closure> (file:///Users/suztomo/Documents/hitomemo/test/mock_firestore_test.dart:32:10)
<asynchronous suspension>
#5 testWidgets.<anonymous closure>.<anonymous closure> (package:flutter_test/src/widget_tester.dart:124:25)
#6 TestWidgetsFlutterBinding._runTestBody (package:flutter_test/src/binding.dart:696:19)
<asynchronous suspension>
#9 TestWidgetsFlutterBinding._runTest (package:flutter_test/src/binding.dart:679:14)
#10 AutomatedTestWidgetsFlutterBinding.runTest.<anonymous closure> (package:flutter_test/src/binding.dart:1050:24)
#16 AutomatedTestWidgetsFlutterBinding.runTest (package:flutter_test/src/binding.dart:1047:15)
#17 testWidgets.<anonymous closure> (package:flutter_test/src/widget_tester.dart:121:22)
#18 Declarer.test.<anonymous closure>.<anonymous closure>.<anonymous closure> (package:test_api/src/backend/declarer.dart:171:27)
<asynchronous suspension>
#19 Invoker.waitForOutstandingCallbacks.<anonymous closure> (package:test_api/src/backend/invoker.dart:242:15)
#24 Invoker.waitForOutstandingCallbacks (package:test_api/src/backend/invoker.dart:239:5)
#25 Declarer.test.<anonymous closure>.<anonymous closure> (package:test_api/src/backend/declarer.dart:169:33)
#30 Declarer.test.<anonymous closure> (package:test_api/src/backend/declarer.dart:168:13)
#31 Invoker._onRun.<anonymous closure>.<anonymous closure>.<anonymous closure>.<anonymous closure> (package:test_api/src/backend/invoker.dart:392:25)
#45 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:384:19)
#46 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:418:5)
#47 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12)
(elided 28 frames from class _FakeAsync, package dart:async, package dart:async-patch, and package stack_trace)
The test description was:
FieldValue.serverTimestamp does not work
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
ERROR: Test failed. See exception logs above.
The test description was: FieldValue.serverTimestamp does not work
For my use case of FieldValue.serverTimestamp
, just replacing FieldValue.serverTimestamp
with DateTime.new()
resolves the problem, but it seems tough to replace FieldValue.delete()
, which I would use to delete a field from a document.
I appreciate if the library can let me use FieldValue.delete()
.
The example for the package is outdated.
The method createUserWithEmailAndPassword only seems to return null & none of the errors described in the documentation are thrown. It doesn't say this was explicitly implemented in the docs, so I am going to assume it wasn't implemented at all, but would be very nice to have. Being able to test all outcomes of sign up errors and how documents are created in firestore based on sign up would be extremely useful for me.
Google is now requesting that package maintainers release a nnbd pre-release version.
Hello,
I am trying to write a unit test testing firebase authentication fail scenarios. From the read me you suggest to use:
whenCalling(Invocation.method(#signInWithCredential, null))
.on(auth)
.thenThrow(FirebaseAuthException(code: 'bla'));
expect(
() => auth.signInWithCredential(FakeAuthCredential()),
throwsA(isA<FirebaseAuthException>()),
);
Searching online, I don't understand why I cannot import / use whenCalling
. Probably the flutter or dart version doesn't provide anymore this function?
But anyway, I realized that I can simulate the error scenario like this:
firebaseAuthMock = MockFirebaseAuth(authExceptions: AuthExceptions(signInWithEmailAndPassword: FirebaseAuthException(code: 'bla')));
Is it correct? if yes, I don't find it in the read me.
I have this dependencies:
environment:
sdk: ">=2.17.6 <3.0.0"
# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
# dependencies can be manually updated by changing the version numbers below to
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
email_validator: ^2.1.17
firebase_core: ^1.20.1
firebase_auth: ^3.6.3
firebase_storage: ^10.3.11
firebase_messaging: ^13.1.0
google_fonts: ^3.0.1
provider: ^6.0.3
shared_preferences: ^2.0.15
loggy: ^2.0.1+1
dots_indicator: ^2.1.0
tab_indicator_styler: ^2.0.0
percent_indicator: ^4.0.1
flutter_loggy: ^2.0.2
flutter_loggy_dio: ^2.0.1
get_it: ^7.2.0
injectable: ^2.1.0
flutter_switch: ^0.3.2
dio: ^4.0.6
envied: ^0.2.4
json_annotation: ^4.7.0
image_picker: ^0.8.6
overlay_support: ^2.1.0
lite_rolling_switch: ^1.0.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter_driver:
sdk: flutter
flutter_gherkin: ^2.0.0
glob: ^2.1.0
injectable_generator: ^2.1.3
build_runner: ^2.3.2
envied_generator: ^0.2.3+1
json_serializable: ^6.5.4
mockito: ^5.3.2
firebase_auth_mocks: ^0.8.7
The createUserWithEmailAndPassword
method creates a user with a verified email.
Given:
mockFirebaseAuth.createUserWithEmailAndPassword(email: "[email protected]", password: "password");
I get mockFirebaseAuth.currentUser
with _isEmailVerified = true
, but expect false
- email verification is yet to happen.
Is such behavoir expected?
Maybe I updated my packages but I started receiving this error while attempting to write unit tests.
[โ] Flutter (Channel stable, 3.10.6, on macOS 12.6.7 21G651 darwin-x64, locale en-CA)
โข Flutter version 3.10.6 on channel stable at /.../.../.../flutter
โข Upstream repository https://github.com/flutter/flutter.git
โข Framework revision f468f3366c (5 days ago), 2023-07-12 15:19:05 -0700
โข Engine revision cdbeda788a
โข Dart version 3.0.6
โข DevTools version 2.23.1
Package versions:
firebase_auth_mocks: ^0.12.0
firebase_auth: ^4.7.0
Any solutions? Thanks
SOLUTION:
I fixed it, I needed to mockAuth.signInWithEmailAndPassword() [or whichever signing method] in my setUp() function before testing. Thank you for your time
I think it would be useful to make the hardcoded-user configurable (allow it to be created with custom data)
Also, adding a photo URL to the default one could be nice
After writing a test to verify signInAnonymously() is called I get the error form the title. This happens on all calls from the MockFirebaseAuth class.
Here is my test:
NoParams noParams = NoParams();
UserCredential userCredential;
test('Should call Firebase Auth Service', () async {
//arrange
when(mockFirebaseAuth.signInAnonymously())
.thenAnswer((_) async => userCredential);
//act
await authRemoteServiceFirebaseAuth.signInAnonymously(noParams);
//assert
verify(mockFirebaseAuth.signInAnonymously());
'});`
I have a usecase where I am calling the verifyPhoneNumber from the method _verify as shown below.
In my test, I am replacing the firebaseAuth with MockFirebaseAuth. like below
In the main code, I am using the FirebaseAuth.instance while in the test, I am using MockFirebaseAuth as shown
// main.dart
AuthBloc(
firebaseAuth: firebaseAuth,
)
// auth_bloc_test.dart
AuthBloc(
firebaseAuth: MockFirebaseAuth(
signedIn: false,
mockUser: MockUser(
phoneNumber: '0714109322',
),
),
)
Below is the how I am calling firebaseAuth.verifyPhoneNumber()....
class AuthBloc extends Bloc<AuthEvent, AuthState> {
AuthBloc({
required this.firebaseAuth,
}) : super(const _Initial()) {
firebaseAuth.authStateChanges().listen((event) {
if (event != null) {
add(AuthEvent.gotUser(event));
}
});
}
final FirebaseAuth firebaseAuth;
@override
Stream<AuthState> mapEventToState(
AuthEvent event,
) async* {
// other code here
}
void _verify(String phoneNo) async {
await firebaseAuth.verifyPhoneNumber(
phoneNumber: phoneNo,
verificationCompleted: (PhoneAuthCredential cred) {
add(AuthEvent.verificationCompleted(cred));
},
verificationFailed: (exception) {
add(AuthEvent.verificationFailed(exception));
},
codeSent: (verificationId, _) {
add(AuthEvent.codeSent(verificationId));
},
codeAutoRetrievalTimeout: (verificationId) {
add(AuthEvent.codeRetrievalTimeout(verificationId));
},
timeout: const Duration(minutes: 2),
);
}
}
I expected the method call to be mocked and authStateChange to trigger a change, but I am getting an error as shown below
NoSuchMethodError: Class 'MockFirebaseAuth' has no instance method 'verifyPhoneNumber' with matching arguments.
Receiver: Instance of 'MockFirebaseAuth'
Tried calling: verifyPhoneNumber(phoneNumber: "phoneNumber", verificationCompleted: Closure: (PhoneAuthCredential) => void, verificationFailed: Closure: (FirebaseAuthException) => void, codeSent: Closure: (String, int?) => void, codeAutoRetrievalTimeout: Closure: (String) => void, autoRetrievedSmsCodeForTesting: null, timeout: Instance of 'Duration', forceResendingToken: 1)
Found: verifyPhoneNumber({required String phoneNumber, required (PhoneAuthCredential) => void verificationCompleted, required (FirebaseAuthException) => void verificationFailed, required (String, int?) => void codeSent, required (String) => void codeAutoRetrievalTimeout, String? autoRetrievedSmsCodeForTesting, Duration timeout, int? forceResendingToken}) => Future
My pubspec.yaml is like below
name: phone_firebase_auth
description: A new Flutter project.
version: 1.0.0+1
publish_to: none
environment:
sdk: ">=2.12.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
bloc: ^7.0.0
flutter_bloc: ^7.0.0
intl: ^0.17.0
responsive_sizer: ^3.0.4+4
firebase_core: ^1.4.0
firebase_auth: ^3.0.1
freezed_annotation: ^0.14.2
firebase_auth_mocks: ^0.8.0
country_list_pick:
flutter_typeahead:
phone_number:
random_color_scheme:
google_fonts: ^2.1.0
logger_flutter:
git:
url: https://github.com/xaynetwork/logger_flutter.git
ref: da8109894224abae1b8d1e9702e6478fb5ba2fdc
dev_dependencies:
flutter_test:
sdk: flutter
bloc_test: ^8.0.0
mocktail: ^0.1.0
very_good_analysis: ^2.1.0
freezed: ^0.14.2
build_runner:
change_app_package_name:
flutter:
uses-material-design: true
generate: true
Kindly assist.
As mentioned in #15 .
This can be done at https://github.com/atn832/firebase_auth_mocks/blob/master/lib/src/mock_firebase_user.dart.
Hello,
would be great to have access to MockUser.isAnonymous
, it seems like it should be relatively simple to do. Also happy to submit a PR.
The documentation refers to a function named whenCalling() to define the behavior of testing of throwing exceptions. However, it doesn't say where this function come from and it doesn't look like the package includes this function.
I believe this function should either be provided with the package or an explicit mention to the package that defines it should be included in the documentation.
Hey, I wanted to contribute with an implementation for signInWithPopup
, however I came across the problem that AuthProvider
is not exported. I wrote about this here.
Do you think there's a workaround to this? I'd be happy to contribute but other than having AuthProvider
accessible, I don't know how :(
$ flutter pub get
Because firebase_auth_mocks 0.7.1 depends on firebase_auth ^1.3.0 and depends on firebase_auth 2.0.0, firebase_auth_mocks 0.7.1 is forbidden.
So, because depends on firebase_auth_mocks 0.7.1, version solving failed.
Running "flutter pub get" in ...
pub get failed (1; So, because depends on firebase_auth_mocks 0.7.1, version solving
failed.)
updateDisplayName is not yet implemented, so any call to it will throw an error `noSuchMethod.
Recently new firebase package versions were released with many breaking changes. Here is the changelog: https://pub.dev/packages/firebase_auth/changelog
Specifically for my case I need the authStateChanges
method implemented.
Please implement the withConverter method (currently throws UnimplementedError).
Can we add the export MockUserCredential firebase_auth_mocks.dart in order to use MockUserCredential easily into our project?
User.delete()
should make the current user null and notify its listers. i.e. Something similar to MockFirebaseAuth.signOut()
. Currently it does nothing.
Most useful for custom claims, which can be used for role-based access control.
/// Returns a [IdTokenResult] containing the users JSON Web Token (JWT) and
/// other metadata.
///
/// If [forceRefresh] is `true`, the token returned will be refreshed regardless
/// of token expiration.
Future<IdTokenResult> getIdTokenResult([bool forceRefresh = false]) {
return _delegate.getIdTokenResult(forceRefresh);
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.