mock_cloud_firestore
mock_cloud_firestore copied to clipboard
MissingPluginException - No implementation found for method Query#addSnapshotListener
When running one of my tests, the following exception is thrown:
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following MissingPluginException was thrown running a test (but after the test had completed):
MissingPluginException(No implementation found for method Query#addSnapshotListener on channel
plugins.flutter.io/cloud_firestore)
It is thrown at a code location where I do
_tmpStream.listen(..)
My code is in essence:
Observable<QuerySnapshot> myStream = new Observable(_db.....snapshots());
Observable<MyObj> _tmpStream = myStream.switchMap(......);
_tmpStream.listen(...); // Exception is thrown here.
That code is using rxDart types as you can see but I think the exception is caused by a missing implementation of the mock_cloud_firestore.
Sorry i don't get missing implementation here, i am not familiar with rxDart. Can you write a failing test for it?
@ozanturksever I will try to create a test that fails.
@ozanturksever I was unfortunately not able to reproduce it in the tests since prior stuff is failing.
As you can see in https://github.com/sceee/mock_cloud_firestore/commit/b698efddba6b680c688425b9bb5801b1d64b1868 , I tried to setup such an example that fails.
But the issue is, the projRef.snapshots() call does not deliver any values - but it should and live Firestore definitely behaves that way.
I don't understand why the snapshots call immediately returns values in my other tests, but as long as this is not fixed the call in line 44 will not be made which probably then causes the exception.
Could you please have a look at it why that snapshots call does not immediately return the first match set?