Comments (1)
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.
from mocktail.
Related Issues (20)
- Less verbose Mock declarations HOT 3
- Dependencies causing issues DCM action HOT 4
- Incompatible with dart_metrics_code HOT 5
- Unit Test type 'Null' is not a subtype of type 'Future<ApiResponse<TokenModel, TokenErrors>>' HOT 1
- Unexpected verify `callCount` HOT 2
- feat: support mocking network images for NetworkImage HOT 3
- [Question] How to unit test getters for usages of other class properties HOT 4
- Mock cubit that is required in bloc HOT 3
- verifyInOrder AND verify count HOT 3
- Stubbing Future<void> Example from README does not compile HOT 2
- Incompatible with Flutter 3.10 HOT 3
- The "when" function does not create a stub HOT 4
- Mocktail does not match function calls correctly when used with Riverpod and AsyncValue HOT 4
- "Delegate" function call in mock to other function - never called HOT 4
- State of 'mocktail' HOT 4
- Confusing failure with nested mocks HOT 6
- Calling `when` consecutively doesn't stub mocks HOT 2
- Not compatible with freezed 2.4.2 HOT 5
- mocktail could offer string diffs on call failures? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mocktail.