Closed eRuaro closed 2 years ago
Hi @eRuaro ! Thanks for submitting an issue.
The official testing documentation may help with this. There are different examples out there that can help. Let me know if the documentation is of any help 😃.
Closing for now since it doesn't appear there are any actionable next steps. Feel free to comment with any additional questions and I'm happy to continue the conversation 👍
Description
How do I test state changes when the cubit has an initialization function?
I have a cubit which looks like this:
Wherein the state classes looks like this:
I wanted to test what the cubit would emit by following this article: https://medium.com/flutter-community/unit-testing-with-bloc-b94de9655d86
The test file looks like this:
The last test in the first
group
confuses me, as I thought I'd have to emit the state class. So I tried out in the secondgroup
of what was used in the articled I linked above which usesexpectLater
which returns this error:How do I fix the last test for the second
group
? Also is there a way to useblocTest
instead for state class changes instead of usingexpectLater
andtest
?