diff --git a/packages/cloud_functions/cloud_functions/example/pubspec.yaml b/packages/cloud_functions/cloud_functions/example/pubspec.yaml index fa2c58c804e4..22a1ea7dd717 100644 --- a/packages/cloud_functions/cloud_functions/example/pubspec.yaml +++ b/packages/cloud_functions/cloud_functions/example/pubspec.yaml @@ -2,8 +2,8 @@ name: cloud_functions_example description: Demonstrates how to use the cloud_functions plugin. environment: - sdk: ">=2.12.0 <3.0.0" - flutter: ">=1.12.13+hotfix.4" + sdk: '>=2.12.0 <3.0.0' + flutter: '>=1.12.13+hotfix.4' dependencies: cloud_functions: @@ -27,7 +27,7 @@ dependency_overrides: path: ../../../firebase_core/firebase_core_web dev_dependencies: - drive: 0.1.0 + drive: ^1.0.0-1.0.nullsafety.1 flutter_driver: sdk: flutter test: any diff --git a/packages/cloud_functions/cloud_functions/example/test_driver/cloud_functions_e2e.dart b/packages/cloud_functions/cloud_functions/example/test_driver/cloud_functions_e2e.dart index 878a9c2e1cf6..a576716e83b1 100644 --- a/packages/cloud_functions/cloud_functions/example/test_driver/cloud_functions_e2e.dart +++ b/packages/cloud_functions/cloud_functions/example/test_driver/cloud_functions_e2e.dart @@ -1,12 +1,7 @@ -// ignore_for_file: require_trailing_commas -// @dart = 2.9 - // Copyright 2020, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// @dart=2.9 - import 'package:cloud_functions/cloud_functions.dart'; import 'package:drive/drive.dart' as drive; import 'package:firebase_core/firebase_core.dart'; @@ -20,7 +15,8 @@ String kTestFunctionTimeout = 'testFunctionTimeout'; String kTestMapConvertType = 'testMapConvertType'; void testsMain() { - HttpsCallable callable; + late HttpsCallable callable; + setUpAll(() async { await Firebase.initializeApp(); FirebaseFunctions.instance.useFunctionsEmulator('localhost', 5001); @@ -85,15 +81,16 @@ void testsMain() { }); test( - '[HttpsCallableResult.data] should return Map type for returned objects', - () async { - HttpsCallable callable = - FirebaseFunctions.instance.httpsCallable(kTestMapConvertType); + '[HttpsCallableResult.data] should return Map type for returned objects', + () async { + HttpsCallable callable = + FirebaseFunctions.instance.httpsCallable(kTestMapConvertType); - var result = await callable(); + var result = await callable(); - expect(result.data, isA>()); - }); + expect(result.data, isA>()); + }, + ); }); group('FirebaseFunctionsException', () { @@ -107,7 +104,7 @@ void testsMain() { expect(e.message, equals('Invalid test requested.')); return; } catch (e) { - fail(e); + fail('$e'); } }); @@ -122,18 +119,21 @@ void testsMain() { } on FirebaseFunctionsException catch (e) { expect(e.code, equals('cancelled')); expect( - e.message, - equals( - 'Response data was requested to be sent as part of an Error payload, so here we are!')); + e.message, + equals( + 'Response data was requested to be sent as part of an Error payload, so here we are!', + ), + ); expect(e.details, equals(data.deepMap)); } catch (e) { - fail(e); + fail('$e'); } }); }); group('region', () { - HttpsCallable customRegionCallable; + late HttpsCallable customRegionCallable; + setUpAll(() async { customRegionCallable = FirebaseFunctions.instanceFor(region: 'europe-west1') @@ -147,12 +147,13 @@ void testsMain() { }); group('HttpsCallableOptions', () { - HttpsCallable timeoutCallable; + late HttpsCallable timeoutCallable; setUpAll(() async { timeoutCallable = FirebaseFunctions.instance.httpsCallable( - kTestFunctionTimeout, - options: HttpsCallableOptions(timeout: const Duration(seconds: 3))); + kTestFunctionTimeout, + options: HttpsCallableOptions(timeout: const Duration(seconds: 3)), + ); }); test('times out when the provided timeout is exceeded', () async { @@ -164,7 +165,7 @@ void testsMain() { } on FirebaseFunctionsException catch (e) { expect(e.code, equals('deadline-exceeded')); } catch (e) { - fail(e); + fail('$e'); } }); }); diff --git a/packages/cloud_functions/cloud_functions/example/test_driver/cloud_functions_e2e_test.dart b/packages/cloud_functions/cloud_functions/example/test_driver/cloud_functions_e2e_test.dart index fa0a63495989..4a676ab90551 100644 --- a/packages/cloud_functions/cloud_functions/example/test_driver/cloud_functions_e2e_test.dart +++ b/packages/cloud_functions/cloud_functions/example/test_driver/cloud_functions_e2e_test.dart @@ -1,5 +1,4 @@ // ignore_for_file: require_trailing_commas -// @dart = 2.9 // Copyright 2020, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a diff --git a/packages/cloud_functions/cloud_functions/example/test_driver/sample.dart b/packages/cloud_functions/cloud_functions/example/test_driver/sample.dart index c29d1673253d..ee7b9f1a5627 100644 --- a/packages/cloud_functions/cloud_functions/example/test_driver/sample.dart +++ b/packages/cloud_functions/cloud_functions/example/test_driver/sample.dart @@ -1,5 +1,4 @@ // ignore_for_file: require_trailing_commas -// @dart = 2.9 // Copyright 2020, the Chromium project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a