flutter-universal-platform icon indicating copy to clipboard operation
flutter-universal-platform copied to clipboard

Force a platform type when testing

Open martin-robert-fink opened this issue 3 years ago • 1 comments

When running tests, either using variant: TargetPlatformVariant.mobile() or debugDefaultTargetPlatformOverride does not cooperate with UniversalPlatform.

Can you add a method, something like testUniversalPlatformOverride = targetPlatformType to set a platform type for widget testing. Or, perhaps create something that extends from the TestVariant class that could be used.

martin-robert-fink avatar Jul 19 '21 16:07 martin-robert-fink

I would love this as well. This is an extremely useful package, but the lack of testing mechanisms makes it quite hard to use in some cases, which might persuade people to not use the package as a result.

jeroen-meijer avatar Jan 19 '22 14:01 jeroen-meijer