atn832/fake_cloud_firestore

Cannot throw exception on DocumentReference.get() call (#get)

Closed this issue · 1 comments

Using this basic sample code below, no exception is thrown. Using the same code as below for testing #set seems to work fine. What is it that I am missing here?

test('firestore get exception', () async {
      whenCalling(Invocation.method(#get, [], {}))
          .on(firestore.collection('test_collection').doc('test_doc'))
          .thenThrow(FirebaseException(plugin: 'test', message: 'test'));

      await firestore.collection('test_collection').doc('test_doc').get();
    });
atn832 commented

@mrunix00 contributed a PR that fixes this issue. You can get it with version 2.4.3. https://pub.dev/packages/fake_cloud_firestore/changelog#243.