Code Monkey home page Code Monkey logo

firebase_auth_mocks's People

Contributors

aanu1995 avatar atn832 avatar bengmiles avatar benvercammen avatar cedvdb avatar defuncart avatar dfdgsdfg avatar dipeshdulal avatar f-hoedl avatar gaburielcasado avatar gintautassulskus avatar gnurik avatar ketanchoyal avatar kody-liou avatar kornperkus avatar mazzonem avatar rexios80 avatar robyf avatar shepeliev avatar thedalelakes avatar yusufabdelaziz avatar zariweyo avatar zohenn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

firebase_auth_mocks's Issues

the state changes don't seem to be invoked/called

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!

Support the latest firebase_auth 0.16.0

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. ๐Ÿ‘

Feature request: Support for providerData

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.

firebase_auth 3.5.0 breaks verifyPhoneNumber()

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({
               ^

Running `flutter pub add` doesn't default to version without mockito

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

The getter 'user' was called on null.

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

Request: add _maybeThrowException() to reload method

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.

Expose MockUserCredential

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?

Consolidate the generation of the token result

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)

What can we expect to be return from user.displayName

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

conflict with firebase_auth version

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.

Bump Pubspec version

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

Clean up `test(() async => await ...`

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)

No implementation of User.delete and User.reauthenticateWithCredential

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.

Implement signInWithPhoneNumber

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!

cloud_firestore_mocks failure upon FieldValue.serverTimestamp() and FieldValue.delete()

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
    });

Error Message

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().

createUserWithEmailAndPassword only returns null

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.

Support for nnbd

Google is now requesting that package maintainers release a nnbd pre-release version.

Unit test for firebase auth exceptions

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 argument type 'Map<String, Object>' can't be assigned to the parameter type 'PigeonIdTokenResult'

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

Screen Shot 2023-07-17 at 10 59 34 PM

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

ERROR: Bad state: No method stub was called from within `when()`

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());
'});`

NoSuchMethodError: Class 'MockFirebaseAuth' has no instance method 'verifyPhoneNumber' with matching arguments.

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.

Add `isAnonymous` to User mock

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.

Documentation function "whenCalling()" origin is missing

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.

Support for signInWithPopup

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 :(

Version solving fails with `firebase_auth` 2.0.0

$ 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()

updateDisplayName is not yet implemented, so any call to it will throw an error `noSuchMethod.

Feature request: Add support for mocking getIdTokenResult.

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);
  }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.