I wrote a tool called mockito to make this a bit easier. It supports refactoring well.
Refactor friendly mocking in dart [closed]
-
21-09-2022 - |
Pergunta
So far all the mocking libraries I've seen in dart (unittest/mock, dartmocks) use strings to represent the method calls. e.g.
foo.when(callsTo('fum')).thenReturn(...);
problem is when I want to rename fum then the IDE won't pick up my mocked method calls so I'll have to manually change them.
Anyone aware of any that work with actual method calls (foo.fum()
)? i.e. similar to mockito etc in Java
Solução
Outras dicas
Not yet.
You can star Symbols create a tooling gap
It's probably a good idea to create a new issue for your requirement as it's different enough.
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow