adaptive_test
adaptive_test copied to clipboard
feat: add support for skipping tests based on the enforced target platform
Add support for skipping tests instead of failing them based on the enforced target platform defined in the AdaptiveTestConfiguration
class.
Future<void> testExecutable(FutureOr<void> Function() testMain) async {
TestWidgetsFlutterBinding.ensureInitialized();
AdaptiveTestConfiguration.instance
..setSkippedTestPlatform(TargetPlatform.macOS)
..setFailTestOnWrontPlatform(false) <-- Adding this will skip the `testAdaptiveWidgets` tests if you are not running the tests on a macOS platform.
..setDeviceVariants(defaultDeviceConfigs);
await loadFonts();
setupFileComparatorWithThreshold();
await testMain();
}