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

Cannot mock (mockito) functions which return Either #8

Open
Adam-Langley opened this issue Jul 19, 2023 · 1 comment
Open

Cannot mock (mockito) functions which return Either #8

Adam-Langley opened this issue Jul 19, 2023 · 1 comment

Comments

@Adam-Langley
Copy link

In 1.0.0 the Either class was sealed. This breaked the generated mocking code for unit tests.

Is there a need for this class to be sealed?

We are forced to remain on version 0.4.0 - please reconsider sealing.

Thank you

@avdosev
Copy link
Owner

avdosev commented Jul 19, 2023

I think you have encountered the same issue as other Mockito users - dart-lang/mockito#675

Is there a need for this class to be sealed?

Yes, it is necessary for the Exhaustiveness checking introduced in dart 3 to work.

We are forced to remain on version 0.4.0

This is not bad, I recommend you to stay on this version and specify in this issue why it's important for you as a Mockito user to have sealed class support.

Also, I am not closing this discussion to find out new solutions to this problem. But at the moment the abandonment of sealed looks contradictory requiring a switch to a new major version of the package.

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