From 694332921a6031ff95558e55d0c4f37a3f86fab4 Mon Sep 17 00:00:00 2001 From: Sigurd Meldgaard Date: Mon, 9 Jul 2018 16:44:12 +0200 Subject: [PATCH] Update test dependencies (#92) * Update test dependencies * Revert "Update test dependencies" This reverts commit 86a6ae2dadf7f42b3a323d39795f3ca20de80ac6. * Update test dependencies * Fix use of mockito when * NOP * Revert "NOP" This reverts commit dec6a5a57ab1c01df95cfdd953ff3504a9e09041. * Upgrade mockito * Increase SDK dependency * Increase deleay to trigger timeout * Reintroduce include * Relax sdk version constraint --- .travis.yml | 6 ++---- pubspec.yaml | 6 +++--- test/src/client_utils.dart | 8 ++++---- test/timeout_test.dart | 2 +- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index d0ee862..2e8d8d9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,9 @@ language: dart sudo: false -# Run against dev and stable channels. +# Run against the dev channel. dart: - dev - - stable # Define test tasks to run. dart_task: @@ -14,11 +13,10 @@ dart_task: # them against each Dart version. matrix: include: - - dart: stable - dart_task: dartfmt # Wish we could exclude `example` in `analysis_options.yaml` but it seems # blocked by https://github.com/dart-lang/sdk/issues/26212 - dart: dev + dart_task: dartfmt script: - dartanalyzer lib test - for example in example/*; do (cd $example; echo [Analyzing $example]; pub get; dartanalyzer .); done diff --git a/pubspec.yaml b/pubspec.yaml index 432facc..2334e43 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -5,7 +5,7 @@ author: Dart Team homepage: https://github.com/dart-lang/grpc-dart environment: - sdk: '>=1.24.3 <2.0.0' + sdk: '>=2.0.0-dev.58.0 <2.0.0' dependencies: async: '>=1.13.3 <3.0.0' @@ -15,5 +15,5 @@ dependencies: http2: ^0.1.7 dev_dependencies: - mockito: ^2.0.2 - test: ^0.12.0 + mockito: ^3.0.0-beta+1 + test: ^1.2.0 diff --git a/test/src/client_utils.dart b/test/src/client_utils.dart index c8aa148..611a2f2 100644 --- a/test/src/client_utils.dart +++ b/test/src/client_utils.dart @@ -123,8 +123,8 @@ class ClientHarness { stream = new MockStream(); fromClient = new StreamController(); toClient = new StreamController(); - when(transport.makeRequest(typed(any))).thenReturn(stream); - when(transport.onActiveStateChanged = typed(captureAny)).thenReturn(null); + when(transport.makeRequest(any, endStream: anyNamed('endStream'))).thenReturn(stream); + when(transport.onActiveStateChanged = captureAny).thenReturn(null); when(stream.outgoingMessages).thenReturn(fromClient.sink); when(stream.incomingMessages).thenAnswer((_) => toClient.stream); client = new TestClient(channel); @@ -152,7 +152,7 @@ class ClientHarness { void signalIdle() { final ActiveStateHandler handler = - verify(transport.onActiveStateChanged = typed(captureAny)) + verify(transport.onActiveStateChanged = captureAny) .captured .single; expect(handler, isNotNull); @@ -184,7 +184,7 @@ class ClientHarness { } final List
capturedHeaders = - verify(transport.makeRequest(typed(captureAny))).captured.single; + verify(transport.makeRequest(captureAny)).captured.single; validateRequestHeaders(capturedHeaders, path: expectedPath, timeout: toTimeoutString(expectedTimeout), diff --git a/test/timeout_test.dart b/test/timeout_test.dart index 46e3838..603d92b 100644 --- a/test/timeout_test.dart +++ b/test/timeout_test.dart @@ -121,7 +121,7 @@ void main() { Invoker.current.addOutstandingCallback(); try { expect(call.isTimedOut, isFalse); - await new Future.delayed(new Duration(milliseconds: 1)); + await new Future.delayed(new Duration(milliseconds: 2)); expect(call.isTimedOut, isTrue); try { await request;