From c3ec1caac2dad49f0c48f6bdbcecd6bf9cab4feb Mon Sep 17 00:00:00 2001 From: Ferhat Date: Thu, 2 Apr 2020 10:57:07 -0700 Subject: [PATCH] Replace isInstanceOf uses with isA (#53834) * Replace isInstanceOf uses with isA * Update isInstanceOf in flutter tools --- .../flutter/test/services/platform_channel_test.dart | 4 ++-- .../test/commands.shard/hermetic/run_test.dart | 4 ++-- .../build_system/targets/dart_test.dart | 12 ++++++------ .../test/general.shard/testbed_test.dart | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/flutter/test/services/platform_channel_test.dart b/packages/flutter/test/services/platform_channel_test.dart index a1bae5576da..9859a520a5d 100644 --- a/packages/flutter/test/services/platform_channel_test.dart +++ b/packages/flutter/test/services/platform_channel_test.dart @@ -70,7 +70,7 @@ void main() { } }, ); - expect(channel.invokeMethod>('sayHello', 'hello'), throwsA(isInstanceOf())); + expect(channel.invokeMethod>('sayHello', 'hello'), throwsA(isA())); expect(await channel.invokeListMethod('sayHello', 'hello'), ['hello', 'world']); }); @@ -102,7 +102,7 @@ void main() { } }, ); - expect(channel.invokeMethod>('sayHello', 'hello'), throwsA(isInstanceOf())); + expect(channel.invokeMethod>('sayHello', 'hello'), throwsA(isA())); expect(await channel.invokeMapMethod('sayHello', 'hello'), {'hello': 'world'}); }); diff --git a/packages/flutter_tools/test/commands.shard/hermetic/run_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/run_test.dart index af6aaf2a2fc..ff5178f27e1 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/run_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/run_test.dart @@ -105,7 +105,7 @@ void main() { ]); fail('Expect exception'); } on Exception catch (e) { - expect(e, isInstanceOf()); + expect(e, isA()); } final BufferLogger bufferLogger = globals.logger as BufferLogger; expect(bufferLogger.statusText, contains( @@ -162,7 +162,7 @@ void main() { ]); fail('Expect exception'); } on Exception catch (e) { - expect(e, isInstanceOf()); + expect(e, isA()); expect(e.toString(), contains('No pubspec.yaml file found')); } }, overrides: { diff --git a/packages/flutter_tools/test/general.shard/build_system/targets/dart_test.dart b/packages/flutter_tools/test/general.shard/build_system/targets/dart_test.dart index 733491d864b..1a9b62ebad2 100644 --- a/packages/flutter_tools/test/general.shard/build_system/targets/dart_test.dart +++ b/packages/flutter_tools/test/general.shard/build_system/targets/dart_test.dart @@ -77,7 +77,7 @@ void main() { androidEnvironment.defines.remove(kBuildMode); expect( const KernelSnapshot().build(androidEnvironment), - throwsA(isInstanceOf())); + throwsA(isA())); })); test('KernelSnapshot handles null result from kernel compilation', () => testbed.run(() async { @@ -328,33 +328,33 @@ void main() { androidEnvironment.defines.remove(kBuildMode); expect(const AotElfProfile().build(androidEnvironment), - throwsA(isInstanceOf())); + throwsA(isA())); })); test('AotElfProfile throws error if missing target platform', () => testbed.run(() async { androidEnvironment.defines.remove(kTargetPlatform); expect(const AotElfProfile().build(androidEnvironment), - throwsA(isInstanceOf())); + throwsA(isA())); })); test('AotAssemblyProfile throws error if missing build mode', () => testbed.run(() async { iosEnvironment.defines.remove(kBuildMode); expect(const AotAssemblyProfile().build(iosEnvironment), - throwsA(isInstanceOf())); + throwsA(isA())); })); test('AotAssemblyProfile throws error if missing target platform', () => testbed.run(() async { iosEnvironment.defines.remove(kTargetPlatform); expect(const AotAssemblyProfile().build(iosEnvironment), - throwsA(isInstanceOf())); + throwsA(isA())); })); test('AotAssemblyProfile throws error if built for non-iOS platform', () => testbed.run(() async { expect(const AotAssemblyProfile().build(androidEnvironment), - throwsA(isInstanceOf())); + throwsA(isA())); })); test('AotAssemblyProfile generates multiple arches and lipos together', () => testbed.run(() async { diff --git a/packages/flutter_tools/test/general.shard/testbed_test.dart b/packages/flutter_tools/test/general.shard/testbed_test.dart index 57354425aba..bdefe008898 100644 --- a/packages/flutter_tools/test/general.shard/testbed_test.dart +++ b/packages/flutter_tools/test/general.shard/testbed_test.dart @@ -95,7 +95,7 @@ void main() { ProcessUtils: () => null, }); - expect(() => testbed.run(() {}), throwsA(isInstanceOf())); + expect(() => testbed.run(() {}), throwsA(isA())); }); }); }