Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class 'MockReference' has no instance method 'listAll' with matching arguments. #25

Closed
fayez-nazzal opened this issue Aug 26, 2022 · 1 comment

Comments

@fayez-nazzal
Copy link

This package mocks many needed FirebaseStorage functions out of the box, though I find it lacks list and listAll implementation.

Executing this test:

    test('uploaded file to cloud can be listed', () async {
      final instance = MockFirebaseStorage();

      var path = 'test/test/test/test';

      final File testFile = await File('test/fixtures/test.jpg');

      final Reference ref = instance.ref().child(path);

      await ref.putFile(testFile);

      final files = await ref.listAll();

      expect(files.items.length == 1, true);
    });

Gives the following error:

  NoSuchMethodError: Class 'MockReference' has no instance method 'listAll' with matching arguments.
  Receiver: Instance of 'MockReference'
  Tried calling: listAll()
  Found: listAll() => Future<ListResult>
  dart:core                                                              Object.noSuchMethod
  package:firebase_storage_mocks/src/mock_storage_reference.dart 123:56  MockReference.noSuchMethod
  package:firebase_storage/src/reference.dart 91:22                      MockReference.listAll
@atn832
Copy link
Owner

atn832 commented Mar 13, 2023

Fixed by #33.

@atn832 atn832 closed this as completed Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants