From b3e4b419125b67fb1bad7283fed53fb0b90e027b Mon Sep 17 00:00:00 2001 From: ValentinVignal Date: Tue, 12 Nov 2024 22:08:37 +0800 Subject: [PATCH 1/2] test: Activate leak tracking --- packages/go_router_builder/pubspec.yaml | 1 + .../go_router_builder/test/flutter_test_config.dart | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 packages/go_router_builder/test/flutter_test_config.dart diff --git a/packages/go_router_builder/pubspec.yaml b/packages/go_router_builder/pubspec.yaml index 6686ec3ba126..515f904624bf 100644 --- a/packages/go_router_builder/pubspec.yaml +++ b/packages/go_router_builder/pubspec.yaml @@ -27,6 +27,7 @@ dev_dependencies: flutter: sdk: flutter go_router: ^14.0.0 + leak_tracker_flutter_testing: any test: ^1.20.0 topics: diff --git a/packages/go_router_builder/test/flutter_test_config.dart b/packages/go_router_builder/test/flutter_test_config.dart new file mode 100644 index 000000000000..9907e578b84b --- /dev/null +++ b/packages/go_router_builder/test/flutter_test_config.dart @@ -0,0 +1,13 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'dart:async'; + +import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; + +Future testExecutable(FutureOr Function() testMain) async { + LeakTesting.enable(); + LeakTracking.warnForUnsupportedPlatforms = false; + await testMain(); +} From a9e5c6fb0b08195ab0e0e194a82ad5d1d81d4d9a Mon Sep 17 00:00:00 2001 From: ValentinVignal Date: Wed, 11 Dec 2024 23:33:20 +0800 Subject: [PATCH 2/2] Set minimum version of leak_tracker_flutter_testing to 3.0.0 --- packages/go_router_builder/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/go_router_builder/pubspec.yaml b/packages/go_router_builder/pubspec.yaml index 515f904624bf..db505ff5c353 100644 --- a/packages/go_router_builder/pubspec.yaml +++ b/packages/go_router_builder/pubspec.yaml @@ -27,7 +27,7 @@ dev_dependencies: flutter: sdk: flutter go_router: ^14.0.0 - leak_tracker_flutter_testing: any + leak_tracker_flutter_testing: ">=3.0.0" test: ^1.20.0 topics: