Closed lsaudon closed 1 year ago
AFAIK this is only possible with some goodwill from the package maintainers.
If you have access to the class library (which is not the case for ProcessResult
), the solution is to provide the interface of the class as a test-only interface class
:
@visibleForTesting
interface class YouCantMockMeInterface {
/// mockable stuff, go here
}
final class YouCantMockMe implements YouCantMockMeInterface {}
In this way, mocks can be done on methods and elements that use the YouCantMockMeInterface
as type.
Describe the issue I try to update my package to dart 3. I have this error The class 'ProcessResult' can't be implemented outside of its library because it's a final class.