adaptive_test icon indicating copy to clipboard operation
adaptive_test copied to clipboard

feat: add support for skipping tests based on the enforced target platform

Open Cteq3132 opened this issue 9 months ago • 0 comments

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();
}

Cteq3132 avatar May 13 '24 12:05 Cteq3132