diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 7640510b..de461b9c 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: true matrix: - pkg: [pubnub, pubnub_flutter] + pkg: [pubnub] steps: - name: Checkout repository uses: actions/checkout@v3 @@ -40,7 +40,7 @@ jobs: restore-keys: | ${{ runner.os }}-${{ matrix.pkg }}- - name: Setup Dart stable - uses: dart-lang/setup-dart@v1.3 + uses: dart-lang/setup-dart@v1.5.0 - name: "Build and run tests for '${{ matrix.pkg }}'" env: PKG: ${{ matrix.pkg }} @@ -51,7 +51,7 @@ jobs: git clone https://github.com/flutter/flutter.git -b stable "$FLUTTER_PATH" export PATH="$PATH:$FLUTTER_PATH/bin" fi - dart pub global activate derry 1.3.0 + dart pub global activate derry 1.5.0 cd "${{ github.workspace }}/${{ matrix.pkg }}" [[ ${{ matrix.pkg }} == "pubnub_flutter" ]] && flutter pub get || dart pub get derry validate analysis diff --git a/.pubnub.yml b/.pubnub.yml index d9d61db9..2d01df2c 100644 --- a/.pubnub.yml +++ b/.pubnub.yml @@ -1,5 +1,10 @@ --- changelog: + - date: 2023-05-18 + version: v4.2.3 + changes: + - type: bug + text: "Fixes issue of losing timetoken value precision in web environment." - date: 2022-11-14 version: v4.2.2 changes: @@ -415,7 +420,7 @@ supported-platforms: platforms: - "Dart SDK >=2.6.0 <3.0.0" version: "PubNub Dart SDK" -version: "4.2.2" +version: "4.2.3" sdks: - full-name: PubNub Dart SDK diff --git a/acceptance_tests/lib/src/hooks/mock_server_hook.dart b/acceptance_tests/lib/src/hooks/mock_server_hook.dart index f2f016c6..a0cbe7d2 100644 --- a/acceptance_tests/lib/src/hooks/mock_server_hook.dart +++ b/acceptance_tests/lib/src/hooks/mock_server_hook.dart @@ -13,13 +13,17 @@ class MockServerHook extends Hook { Iterable tags, ) async { try { - var tagParts = tags.firstWhere((element) => element.name.startsWith('@contract=')).name.split('='); + var tagParts = tags + .firstWhere((element) => element.name.startsWith('@contract=')) + .name + .split('='); var contract = tagParts.skip(1).first; // await Future.delayed(Duration(seconds: 3)); - var res = await http.get(Uri.parse('http://localhost:8090/init?__contract__script__=$contract')); + var res = await http.get(Uri.parse( + 'http://localhost:8090/init?__contract__script__=$contract')); // check for 200 response and fail scenario if not 200 @@ -35,8 +39,8 @@ class MockServerHook extends Hook { int myData = 0; @override - Future onAfterStep( - covariant PubNubWorld world, ScenarioRunnable scenario, String step, StepResult stepResult) async { + Future onAfterStep(covariant PubNubWorld world, + ScenarioRunnable scenario, String step, StepResult stepResult) async { // print( // 'Hook step: $step, result: ${stepResult.result} ${stepResult.resultReason}'); @@ -58,12 +62,12 @@ class MockServerHook extends Hook { // '[Hook] x ${failedExp.length}, . ${pendingExp.length}, v ${succeededExp.length}'); if (failedExp.isNotEmpty) { - return StepResult( - stepResult.elapsedMilliseconds, StepExecutionResult.fail, 'Failed expectations: $failedExp.'); + return StepResult(stepResult.elapsedMilliseconds, + StepExecutionResult.fail, 'Failed expectations: $failedExp.'); } } catch (e) { - return StepResult( - stepResult.elapsedMilliseconds, StepExecutionResult.error, 'Unable to verify expectations: $e.'); + return StepResult(stepResult.elapsedMilliseconds, + StepExecutionResult.error, 'Unable to verify expectations: $e.'); } } diff --git a/acceptance_tests/lib/src/parameters/keyset.dart b/acceptance_tests/lib/src/parameters/keyset.dart index cbb2bd39..eda159de 100644 --- a/acceptance_tests/lib/src/parameters/keyset.dart +++ b/acceptance_tests/lib/src/parameters/keyset.dart @@ -35,5 +35,6 @@ class KeysetParameter extends CustomParameter { cipherKey: CipherKey.fromUtf8('invalid'), ); } + return null; }); } diff --git a/acceptance_tests/lib/src/reporter.dart b/acceptance_tests/lib/src/reporter.dart index 5c8c7eab..af4050a9 100644 --- a/acceptance_tests/lib/src/reporter.dart +++ b/acceptance_tests/lib/src/reporter.dart @@ -142,6 +142,7 @@ class PubNubReporter extends Reporter { print(''); print(' $scenarioCount scenarios executed'); print('${Color.PASS}✓${Color.RESET} $passedScenarioCount scenarios passed'); - print('${Color.FAIL}x${Color.RESET} ${scenarioCount - passedScenarioCount} scenarios failed'); + print( + '${Color.FAIL}x${Color.RESET} ${scenarioCount - passedScenarioCount} scenarios failed'); } } diff --git a/acceptance_tests/lib/src/steps/pam_v3/step_then_an_auth_error.dart b/acceptance_tests/lib/src/steps/pam_v3/step_then_an_auth_error.dart index cbebcfe8..c0d19feb 100644 --- a/acceptance_tests/lib/src/steps/pam_v3/step_then_an_auth_error.dart +++ b/acceptance_tests/lib/src/steps/pam_v3/step_then_an_auth_error.dart @@ -1,7 +1,6 @@ // import 'package:gherkin/gherkin.dart'; import 'package:pubnub/core.dart'; -import 'package:pubnub/pubnub.dart'; import 'package:test/test.dart'; import '../../world.dart'; diff --git a/acceptance_tests/lib/src/steps/pam_v3/step_then_error_detail_message_is_not_empty.dart b/acceptance_tests/lib/src/steps/pam_v3/step_then_error_detail_message_is_not_empty.dart index f196c2f1..d3d252e8 100644 --- a/acceptance_tests/lib/src/steps/pam_v3/step_then_error_detail_message_is_not_empty.dart +++ b/acceptance_tests/lib/src/steps/pam_v3/step_then_error_detail_message_is_not_empty.dart @@ -1,5 +1,4 @@ import 'package:gherkin/gherkin.dart'; -import 'package:pubnub/pubnub.dart'; import 'package:test/test.dart'; import '../../world.dart'; diff --git a/acceptance_tests/lib/src/steps/pam_v3/step_then_error_is_returned.dart b/acceptance_tests/lib/src/steps/pam_v3/step_then_error_is_returned.dart index f3e9674b..c0286a46 100644 --- a/acceptance_tests/lib/src/steps/pam_v3/step_then_error_is_returned.dart +++ b/acceptance_tests/lib/src/steps/pam_v3/step_then_error_is_returned.dart @@ -1,5 +1,4 @@ import 'package:gherkin/gherkin.dart'; -import 'package:pubnub/pubnub.dart'; import 'package:test/test.dart'; import '../../world.dart'; diff --git a/acceptance_tests/lib/src/steps/pam_v3/step_when_i_attempt_publish_with_authToken.dart b/acceptance_tests/lib/src/steps/pam_v3/step_when_i_attempt_publish_with_authToken.dart index bc181225..a341570e 100644 --- a/acceptance_tests/lib/src/steps/pam_v3/step_when_i_attempt_publish_with_authToken.dart +++ b/acceptance_tests/lib/src/steps/pam_v3/step_when_i_attempt_publish_with_authToken.dart @@ -1,6 +1,5 @@ import 'package:gherkin/gherkin.dart'; import 'package:pubnub/core.dart'; -import 'package:pubnub/pubnub.dart'; import 'package:test/expect.dart'; import '../../world.dart'; diff --git a/acceptance_tests/lib/src/steps/step_then_i_receive_successful_response.dart b/acceptance_tests/lib/src/steps/step_then_i_receive_successful_response.dart index 0a8405f5..2382a9be 100644 --- a/acceptance_tests/lib/src/steps/step_then_i_receive_successful_response.dart +++ b/acceptance_tests/lib/src/steps/step_then_i_receive_successful_response.dart @@ -1,4 +1,3 @@ -import 'dart:io'; import 'package:gherkin/gherkin.dart'; import 'package:pubnub/pubnub.dart'; diff --git a/acceptance_tests/lib/src/steps/step_when_i_request_current_time.dart b/acceptance_tests/lib/src/steps/step_when_i_request_current_time.dart index 56084e61..e7eea3d1 100644 --- a/acceptance_tests/lib/src/steps/step_when_i_request_current_time.dart +++ b/acceptance_tests/lib/src/steps/step_when_i_request_current_time.dart @@ -1,5 +1,4 @@ import 'package:gherkin/gherkin.dart'; -import 'package:pubnub/pubnub.dart'; import '../world.dart'; diff --git a/acceptance_tests/lib/src/steps/step_when_i_send_a_signal.dart b/acceptance_tests/lib/src/steps/step_when_i_send_a_signal.dart index 8c17a608..3ae01953 100644 --- a/acceptance_tests/lib/src/steps/step_when_i_send_a_signal.dart +++ b/acceptance_tests/lib/src/steps/step_when_i_send_a_signal.dart @@ -1,5 +1,4 @@ import 'package:gherkin/gherkin.dart'; -import 'package:pubnub/pubnub.dart'; import '../world.dart'; diff --git a/acceptance_tests/lib/src/steps/step_when_i_subscribe.dart b/acceptance_tests/lib/src/steps/step_when_i_subscribe.dart index 26ec0447..a658f954 100644 --- a/acceptance_tests/lib/src/steps/step_when_i_subscribe.dart +++ b/acceptance_tests/lib/src/steps/step_when_i_subscribe.dart @@ -1,4 +1,3 @@ -import 'dart:convert'; import 'package:gherkin/gherkin.dart'; diff --git a/acceptance_tests/pubspec.yaml b/acceptance_tests/pubspec.yaml index 13758068..fdb35621 100644 --- a/acceptance_tests/pubspec.yaml +++ b/acceptance_tests/pubspec.yaml @@ -5,7 +5,7 @@ version: 1.0.0 publish_to: none environment: - sdk: ">=2.17.0 <3.0.0" + sdk: ">=3.0.0 <4.0.0" dependencies: glob: ^2.0.1 diff --git a/pubnub/CHANGELOG.md b/pubnub/CHANGELOG.md index 69630e83..afd9be1e 100644 --- a/pubnub/CHANGELOG.md +++ b/pubnub/CHANGELOG.md @@ -1,3 +1,9 @@ +## v4.2.3 +May 18 2023 + +#### Fixed +- Fixes issue of losing timetoken value precision in web environment. Fixed the following issues reported by [@RicharC293](https://github.com/RicharC293): [#110](https://github.com/pubnub/dart/issues/110). + ## v4.2.2 November 14 2022 diff --git a/pubnub/README.md b/pubnub/README.md index 647a5964..54c4585a 100644 --- a/pubnub/README.md +++ b/pubnub/README.md @@ -14,7 +14,7 @@ To add the package to your Dart or Flutter project, add `pubnub` as a dependency ```yaml dependencies: - pubnub: ^4.2.2 + pubnub: ^4.2.3 ``` After adding the dependency to `pubspec.yaml`, run the `dart pub get` command in the root directory of your project (the same that the `pubspec.yaml` is in). diff --git a/pubnub/lib/src/core/core.dart b/pubnub/lib/src/core/core.dart index 377bb99d..c0d0f75b 100644 --- a/pubnub/lib/src/core/core.dart +++ b/pubnub/lib/src/core/core.dart @@ -21,7 +21,7 @@ class Core { /// Internal module responsible for supervising. SupervisorModule supervisor = SupervisorModule(); - static String version = '4.2.2'; + static String version = '4.2.3'; Core( {Keyset? defaultKeyset, diff --git a/pubnub/lib/src/core/net/exceptions.dart b/pubnub/lib/src/core/net/exceptions.dart index c5911df3..bfd82a22 100644 --- a/pubnub/lib/src/core/net/exceptions.dart +++ b/pubnub/lib/src/core/net/exceptions.dart @@ -2,19 +2,19 @@ import '../exceptions.dart'; import 'response.dart'; class RequestTimeoutException extends PubNubException { - final dynamic? additionalData; + final dynamic additionalData; RequestTimeoutException([this.additionalData]) : super('request timed out'); } class RequestCancelException extends PubNubException { - final dynamic? additionalData; + final dynamic additionalData; RequestCancelException([this.additionalData]) : super('request cancelled'); } class RequestOtherException extends PubNubException { - final dynamic? additionalData; + final dynamic additionalData; RequestOtherException([this.additionalData]) : super('request failed ($additionalData)'); diff --git a/pubnub/lib/src/core/supervisor/signals.dart b/pubnub/lib/src/core/supervisor/signals.dart index 6e6a3702..de9aab92 100644 --- a/pubnub/lib/src/core/supervisor/signals.dart +++ b/pubnub/lib/src/core/supervisor/signals.dart @@ -1,7 +1,6 @@ import 'dart:async'; import 'package:pubnub/core.dart'; -import 'event.dart'; final _logger = injectLogger('pubnub.core.supervisor.signals'); diff --git a/pubnub/lib/src/dx/_endpoints/history.dart b/pubnub/lib/src/dx/_endpoints/history.dart index 16a7e58b..0c244bae 100644 --- a/pubnub/lib/src/dx/_endpoints/history.dart +++ b/pubnub/lib/src/dx/_endpoints/history.dart @@ -65,8 +65,8 @@ class FetchHistoryResult extends Result { if (object is List) { return FetchHistoryResult._( object[0], - Timetoken(BigInt.from(object[1] as int)), - Timetoken(BigInt.from(object[2] as int))); + Timetoken(BigInt.parse('${object[1]}')), + Timetoken(BigInt.parse('${object[2]}'))); } throw getExceptionFromAny(object); @@ -161,7 +161,7 @@ class BatchHistoryResultEntry { cipherKey == null ? object['message'] : decryptFunction!(cipherKey, object['message']), - Timetoken(BigInt.parse(object['timetoken'])), + Timetoken(BigInt.parse('${object['timetoken']}')), object['uuid'], MessageTypeExtension.fromInt(object['message_type']), object['actions'], diff --git a/pubnub/lib/src/dx/_endpoints/objects/membership_metadata.dart b/pubnub/lib/src/dx/_endpoints/objects/membership_metadata.dart index 1c8b8211..4e300f81 100644 --- a/pubnub/lib/src/dx/_endpoints/objects/membership_metadata.dart +++ b/pubnub/lib/src/dx/_endpoints/objects/membership_metadata.dart @@ -59,7 +59,7 @@ class GetMembershipsMetadataParams extends Parameters { /// {@category Objects} class MembershipMetadata { ChannelMetadataDetails _channel; - dynamic? _custom; + dynamic _custom; String _updated; String _eTag; @@ -212,12 +212,12 @@ class GetChannelMembersParams extends Parameters { /// {@category Objects} class ChannelMemberMetadata { final UuidMetadataDetails _uuid; - final dynamic? _custom; + final dynamic _custom; final String _updated; final String _eTag; UuidMetadataDetails get uuid => _uuid; - dynamic? get custom => _custom; + dynamic get custom => _custom; String get updated => _updated; String get eTag => _eTag; diff --git a/pubnub/lib/src/dx/_endpoints/objects/uuid_metadata.dart b/pubnub/lib/src/dx/_endpoints/objects/uuid_metadata.dart index f39e5473..f814afe0 100644 --- a/pubnub/lib/src/dx/_endpoints/objects/uuid_metadata.dart +++ b/pubnub/lib/src/dx/_endpoints/objects/uuid_metadata.dart @@ -56,7 +56,7 @@ class UuidMetadataDetails { String? get externalId => _externalId; String? get profileUrl => _profileUrl; String? get email => _email; - dynamic? get custom => _custom; + dynamic get custom => _custom; String? get updated => _updated; String? get eTag => _eTag; diff --git a/pubnub/lib/src/dx/_utils/exceptions.dart b/pubnub/lib/src/dx/_utils/exceptions.dart index 602b53af..073eabdf 100644 --- a/pubnub/lib/src/dx/_utils/exceptions.dart +++ b/pubnub/lib/src/dx/_utils/exceptions.dart @@ -8,7 +8,7 @@ PubNubException getExceptionFromAny(dynamic error) { } if (error is XmlDocument) { - var details = error.rootElement.getElement('Message')?.text; + var details = error.rootElement.getElement('Message')?.value; return PubNubException( 'Request to third party service failed. Details: $details'); diff --git a/pubnub/lib/src/dx/files/files.dart b/pubnub/lib/src/dx/files/files.dart index e791547e..5a9f7310 100644 --- a/pubnub/lib/src/dx/files/files.dart +++ b/pubnub/lib/src/dx/files/files.dart @@ -54,10 +54,10 @@ class FileDx { Future sendFile( String channel, String fileName, List file, {CipherKey? cipherKey, - dynamic? fileMessage, + dynamic fileMessage, bool? storeFileMessage, int? fileMessageTtl, - dynamic? fileMessageMeta, + dynamic fileMessageMeta, Keyset? keyset, String? using}) async { keyset ??= _core.keysets[using]; @@ -148,7 +148,7 @@ class FileDx { String channel, FileMessage message, {bool? storeMessage, int? ttl, - dynamic? meta, + dynamic meta, CipherKey? cipherKey, Keyset? keyset, String? using}) async { diff --git a/pubnub/lib/src/dx/objects/channel_metadata.dart b/pubnub/lib/src/dx/objects/channel_metadata.dart index 1d17de6e..a3ac63db 100644 --- a/pubnub/lib/src/dx/objects/channel_metadata.dart +++ b/pubnub/lib/src/dx/objects/channel_metadata.dart @@ -1,7 +1,5 @@ import 'package:pubnub/core.dart'; -import '../_endpoints/objects/objects_types.dart'; import 'objects.dart'; -import 'objects_types.dart'; /// Represents a channel metadata. /// diff --git a/pubnub/lib/src/dx/objects/schema.dart b/pubnub/lib/src/dx/objects/schema.dart index 5d7a6ec3..b63fc105 100644 --- a/pubnub/lib/src/dx/objects/schema.dart +++ b/pubnub/lib/src/dx/objects/schema.dart @@ -4,7 +4,7 @@ class UuidMetadataInput { String? name; String? email; - dynamic? custom; + dynamic custom; String? externalId; String? profileUrl; @@ -26,7 +26,7 @@ class UuidMetadataInput { class ChannelMetadataInput { String? name; String? description; - dynamic? custom; + dynamic custom; ChannelMetadataInput({this.name, this.description, this.custom}); diff --git a/pubnub/lib/src/dx/objects/uuid_metadata.dart b/pubnub/lib/src/dx/objects/uuid_metadata.dart index d978295d..27c9d4ed 100644 --- a/pubnub/lib/src/dx/objects/uuid_metadata.dart +++ b/pubnub/lib/src/dx/objects/uuid_metadata.dart @@ -1,7 +1,5 @@ import 'package:pubnub/core.dart'; -import '../_endpoints/objects/objects_types.dart'; import 'objects.dart'; -import 'schema.dart'; /// Representation of UuidMetadata object /// Useful while dealing with one specific `uuid` details diff --git a/pubnub/lib/src/dx/time.dart b/pubnub/lib/src/dx/time.dart index e39d4088..1b50d83b 100644 --- a/pubnub/lib/src/dx/time.dart +++ b/pubnub/lib/src/dx/time.dart @@ -9,6 +9,6 @@ mixin TimeDx on Core { return defaultFlow( core: this, params: TimeParams(), - serialize: (object, [_]) => Timetoken(BigInt.from(object[0] as int))); + serialize: (object, [_]) => Timetoken(BigInt.parse('${object[0]}'))); } } diff --git a/pubnub/lib/src/networking/meta/diagnostics/html.dart b/pubnub/lib/src/networking/meta/diagnostics/html.dart index 997bf86c..9d03e704 100644 --- a/pubnub/lib/src/networking/meta/diagnostics/html.dart +++ b/pubnub/lib/src/networking/meta/diagnostics/html.dart @@ -42,4 +42,5 @@ Diagnostic? getNetworkDiagnostic(dynamic exception) { return AccessDeniedDiagnostic(); } } + return null; } diff --git a/pubnub/lib/src/networking/meta/diagnostics/io.dart b/pubnub/lib/src/networking/meta/diagnostics/io.dart index 24b1f4c7..d96c6c87 100644 --- a/pubnub/lib/src/networking/meta/diagnostics/io.dart +++ b/pubnub/lib/src/networking/meta/diagnostics/io.dart @@ -70,6 +70,7 @@ Diagnostic? getNetworkDiagnostic(dynamic exception) { return AccessDeniedDiagnostic(); } } + return null; } enum _Errno { diff --git a/pubnub/lib/src/parser/parser.dart b/pubnub/lib/src/parser/parser.dart index 3f38a111..518b172a 100644 --- a/pubnub/lib/src/parser/parser.dart +++ b/pubnub/lib/src/parser/parser.dart @@ -3,8 +3,6 @@ import 'package:xml/xml.dart' show XmlDocument; import 'package:pubnub/core.dart'; -import '../core/parser.dart'; - /// @nodoc abstract class Parser { Future decode(String input); diff --git a/pubnub/lib/src/subscribe/envelope.dart b/pubnub/lib/src/subscribe/envelope.dart index ca10ef72..738d7ed3 100644 --- a/pubnub/lib/src/subscribe/envelope.dart +++ b/pubnub/lib/src/subscribe/envelope.dart @@ -1,5 +1,4 @@ import 'package:pubnub/core.dart'; -import 'package:pubnub/pubnub.dart'; /// Represents a message received from a subscription. /// @@ -17,7 +16,7 @@ class Envelope extends BaseMessage { final Timetoken? originalTimetoken; final int? originalRegion; - final dynamic? userMeta; + final dynamic userMeta; dynamic get payload => content; @@ -53,10 +52,10 @@ class Envelope extends BaseMessage { flags: object['f'] as int, uuid: UUID(object['i'] ?? ''), originalTimetoken: object['o'] != null - ? Timetoken(BigInt.parse(object['o']['t'])) + ? Timetoken(BigInt.parse('${object['o']['t']}')) : null, originalRegion: object['o']?['r'], - publishedAt: Timetoken(BigInt.parse(object['p']['t'])), + publishedAt: Timetoken(BigInt.parse('${object['p']['t']}')), region: object['p']['r'], userMeta: object['u'], ); diff --git a/pubnub/pubspec.yaml b/pubnub/pubspec.yaml index 1df49b14..f7d7bd41 100644 --- a/pubnub/pubspec.yaml +++ b/pubnub/pubspec.yaml @@ -1,14 +1,14 @@ name: pubnub description: PubNub SDK v5 for Dart lang (with Flutter support) that allows you to create real-time applications -version: 4.2.2 +version: 4.2.3 homepage: https://www.pubnub.com/docs/sdks/dart environment: - sdk: ">=2.17.0 <3.0.0" + sdk: ">=3.0.0 <4.0.0" scripts: test: - default: dart pub run test -P unit + default: dart run test -P unit integration: dart pub run test -P integration validate: analysis: dart analyze --fatal-warnings lib @@ -26,4 +26,4 @@ dependencies: pool: ^1.5.0 xml: ^6.1.0 dev_dependencies: - test: 1.16.7 + test: ^1.24.3 diff --git a/pubnub/test/integration/subscribe/subscribe_test.dart b/pubnub/test/integration/subscribe/subscribe_test.dart index e7ebc298..fe22283b 100644 --- a/pubnub/test/integration/subscribe/subscribe_test.dart +++ b/pubnub/test/integration/subscribe/subscribe_test.dart @@ -5,7 +5,6 @@ import 'dart:io'; import 'package:test/test.dart'; import 'package:pubnub/pubnub.dart'; -import 'package:pubnub/core.dart'; import '_utils.dart'; diff --git a/pubnub/test/unit/dx/channel_test.dart b/pubnub/test/unit/dx/channel_test.dart index 68be6655..845c6343 100644 --- a/pubnub/test/unit/dx/channel_test.dart +++ b/pubnub/test/unit/dx/channel_test.dart @@ -1,10 +1,6 @@ import 'package:test/test.dart'; import 'package:pubnub/pubnub.dart'; -import 'package:pubnub/core.dart'; - -import 'package:pubnub/src/dx/channel/channel.dart'; -import 'package:pubnub/src/dx/channel/channel_history.dart'; import '../net/fake_net.dart'; part './fixtures/channel.dart'; diff --git a/pubnub/test/unit/dx/file_test.dart b/pubnub/test/unit/dx/file_test.dart index 8ba8c09f..6523cf3d 100644 --- a/pubnub/test/unit/dx/file_test.dart +++ b/pubnub/test/unit/dx/file_test.dart @@ -3,7 +3,6 @@ import 'package:pubnub/crypto.dart'; import 'package:test/test.dart'; import 'package:pubnub/pubnub.dart'; -import 'package:pubnub/core.dart'; import '../net/fake_net.dart'; part 'fixtures/files.dart'; diff --git a/pubnub/test/unit/dx/message_action_test.dart b/pubnub/test/unit/dx/message_action_test.dart index 59eb524b..0e26a9c2 100644 --- a/pubnub/test/unit/dx/message_action_test.dart +++ b/pubnub/test/unit/dx/message_action_test.dart @@ -1,9 +1,6 @@ import 'package:test/test.dart'; import 'package:pubnub/pubnub.dart'; -import 'package:pubnub/core.dart'; - -import 'package:pubnub/src/dx/_utils/utils.dart'; import '../net/fake_net.dart'; diff --git a/pubnub/test/unit/dx/publish_test.dart b/pubnub/test/unit/dx/publish_test.dart index 968d16af..4d2df118 100644 --- a/pubnub/test/unit/dx/publish_test.dart +++ b/pubnub/test/unit/dx/publish_test.dart @@ -1,8 +1,6 @@ import 'package:test/test.dart'; import 'package:pubnub/pubnub.dart'; -import 'package:pubnub/core.dart'; -import 'package:pubnub/src/dx/_utils/utils.dart'; import '../net/fake_net.dart'; part './fixtures/publish.dart'; diff --git a/pubnub/test/unit/dx/push_test.dart b/pubnub/test/unit/dx/push_test.dart index 35ae0989..c090ac18 100644 --- a/pubnub/test/unit/dx/push_test.dart +++ b/pubnub/test/unit/dx/push_test.dart @@ -1,9 +1,6 @@ import 'package:test/test.dart'; import 'package:pubnub/pubnub.dart'; -import 'package:pubnub/core.dart'; -import 'package:pubnub/src/dx/_endpoints/push.dart'; -import 'package:pubnub/src/dx/_utils/utils.dart'; import '../net/fake_net.dart'; part './fixtures/push.dart'; diff --git a/pubnub/test/unit/net/utils.dart b/pubnub/test/unit/net/utils.dart index 308c7be9..039ca63a 100644 --- a/pubnub/test/unit/net/utils.dart +++ b/pubnub/test/unit/net/utils.dart @@ -8,13 +8,16 @@ void main() { expect(isHeaderForbidden('Content-Length'), equals(true)); }); - test('isHeaderForbidden should return true for any Sec- or Proxy- header', () { + test('isHeaderForbidden should return true for any Sec- or Proxy- header', + () { expect(isHeaderForbidden('Sec-Test-1'), equals(true)); expect(isHeaderForbidden('Sec-Random-2'), equals(true)); expect(isHeaderForbidden('Proxy-Whatever'), equals(true)); }); - test('isHeaderForbidden should return false for any other header not specified', () { + test( + 'isHeaderForbidden should return false for any other header not specified', + () { expect(isHeaderForbidden('X-Custom-Header'), equals(false)); expect(isHeaderForbidden('Content-Type'), equals(false)); });