flutter_test_config.dart 1.11 KB
Newer Older
Ian Hickson's avatar
Ian Hickson committed
1
// Copyright 2014 The Flutter Authors. All rights reserved.
2 3 4
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

5 6 7
import 'dart:async';

import 'package:flutter/rendering.dart';
8
import 'package:flutter_test/flutter_test.dart';
9
import 'package:leak_tracker/leak_tracker.dart';
10

11 12 13
import '_goldens_io.dart'
  if (dart.library.html) '_goldens_web.dart' as flutter_goldens;

14 15 16
/// Test configuration for each test library in this directory.
///
/// See https://api.flutter.dev/flutter/flutter_test/flutter_test-library.html.
17
Future<void> testExecutable(FutureOr<void> Function() testMain) {
18 19 20 21
  // Enable checks because there are many implementations of [RenderBox] in this
  // package can benefit from the additional validations.
  debugCheckIntrinsicSizes = true;

22 23 24 25
  // Make tap() et al fail if the given finder specifies a widget that would not
  // receive the event.
  WidgetController.hitTestWarningShouldBeFatal = true;

26 27
  LeakTrackingTestConfig.warnForNonSupportedPlatforms = false;

28
  // Enable golden file testing using Skia Gold.
29 30
  return flutter_goldens.testExecutable(testMain);
}