From 61362cff85816a0dfffb04ddc47a35e3e9ae3f7d Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Tue, 18 Aug 2020 08:41:02 -0700 Subject: [PATCH] Move away from deprecated NoSuchMethodError to NoSuchMethodError.withInvocation (#63974) --- .../flutter/test/foundation/error_reporting_test.dart | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/flutter/test/foundation/error_reporting_test.dart b/packages/flutter/test/foundation/error_reporting_test.dart index a2ee99b983b..2fa48cd78c2 100644 --- a/packages/flutter/test/foundation/error_reporting_test.dart +++ b/packages/flutter/test/foundation/error_reporting_test.dart @@ -162,22 +162,24 @@ Future main() async { test('Error reporting - NoSuchMethodError', () async { expect(console, isEmpty); - final dynamic exception = NoSuchMethodError(5, #foo, [2, 4], null); // ignore: deprecated_member_use + final dynamic exception = NoSuchMethodError.withInvocation(5, + Invocation.method(#foo, [2, 4])); + FlutterError.dumpErrorToConsole(FlutterErrorDetails( exception: exception, )); expect(console.join('\n'), matches( r'^══╡ EXCEPTION CAUGHT BY FLUTTER FRAMEWORK ╞═════════════════════════════════════════════════════════\n' r'The following NoSuchMethodError was thrown:\n' - r'Receiver: 5\n' - r'Tried calling: foo = 2, 4\n' + r'int has no foo method accepting arguments \(_, _\)\n' r'════════════════════════════════════════════════════════════════════════════════════════════════════$', )); console.clear(); FlutterError.dumpErrorToConsole(FlutterErrorDetails( exception: exception, )); - expect(console.join('\n'), 'Another exception was thrown: NoSuchMethodError: Receiver: 5'); + expect(console.join('\n'), + 'Another exception was thrown: NoSuchMethodError: int has no foo method accepting arguments (_, _)'); console.clear(); FlutterError.resetErrorCount(); });