You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a good way to mock or stub the loggingService when writing unit tests? Or perhaps overriding the service scope resolution?
Basically I'd like to test a method that ends up calling loggingService.xxx in some cases, and right now when I hit those branches I get output like the following:
Bad state: Not running inside a service scope zone.
package:gcloud/service_scope.dart 140:5 lookup
package:appengine/src/logging.dart 67:31 loggingService
package:cocoon_service/github.dart 21:5 getPullRequest
===== asynchronous gap ===========================
dart:async _AsyncAwaitCompleter.completeError
package:cocoon_service/github.dart getPullRequest
===== asynchronous gap ===========================
dart:async _asyncThenWrapperHelper
package:cocoon_service/request_handlers/github_webhook.dart githubWebhookPullRequest
test/request_handlers/github_webhook_test.dart 77:13 main.<fn>.<fn>
No matching calls (actually, no calls at all).
(If you called `verify(...).called(0);`, please instead use `verifyNever(...);`.)
package:test_api fail
package:mockito/src/mock.dart 641:7 _VerifyCall._checkWith
package:mockito/src/mock.dart 834:18 _makeVerify.<fn>
test/request_handlers/github_webhook_test.dart 39:13 main.<fn>.<fn>
✖ githubWebhookPullRequest Rejects non-json
Exited (1)
The text was updated successfully, but these errors were encountered:
Is there a good way to mock or stub the loggingService when writing unit tests? Or perhaps overriding the service scope resolution?
Basically I'd like to test a method that ends up calling
loggingService.xxx
in some cases, and right now when I hit those branches I get output like the following:The text was updated successfully, but these errors were encountered: