Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: export retry_behavior #10

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/src/network_request.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:dio/dio.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:sturdy_http/src/retry_behavior.dart';
import 'package:sturdy_http/sturdy_http.dart';

part 'network_request.freezed.dart';
Expand Down
1 change: 0 additions & 1 deletion lib/src/sturdy_http.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'dart:isolate';
import 'package:collection/collection.dart';
import 'package:dio/dio.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:sturdy_http/src/retry_behavior.dart';
import 'package:sturdy_http/sturdy_http.dart';
import 'package:uuid/uuid.dart';

Expand Down
1 change: 1 addition & 0 deletions lib/sturdy_http.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ export 'src/sturdy_http.dart';
export 'src/sturdy_http_event_listener.dart';
export 'src/network_request.dart';
export 'src/network_response.dart';
export 'src/retry_behavior.dart';
18 changes: 8 additions & 10 deletions test/src/sturdy_http_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ import 'dart:io';
import 'package:charlatan/charlatan.dart';
import 'package:dio/dio.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:sturdy_http/src/retry_behavior.dart' as rb;
import 'package:sturdy_http/src/retry_behavior.dart';
import 'package:sturdy_http/sturdy_http.dart';
import 'package:test/test.dart';
import 'package:test/test.dart' hide Retry;

part 'sturdy_http_test.freezed.dart';
part 'sturdy_http_test.g.dart';
Expand Down Expand Up @@ -42,7 +40,7 @@ void main() {
List<Interceptor> interceptors = const [],
Map<String, String>? proxy,
bool inferContentType = false,
rb.RetryBehavior retryBehavior = const rb.NeverRetry(),
RetryBehavior retryBehavior = const NeverRetry(),
}) {
return SturdyHttp(
baseUrl: baseUrl,
Expand Down Expand Up @@ -832,7 +830,7 @@ void main() {
await buildSubject().execute<Json, Result<bool, String>>(
const GetRequest(
defaultPath,
retryBehavior: rb.Retry(
retryBehavior: Retry(
maxRetries: 3,
retryInterval: Duration(milliseconds: 100),
),
Expand Down Expand Up @@ -875,7 +873,7 @@ void main() {
await buildSubject().execute<Json, Result<bool, String>>(
const GetRequest(
defaultPath,
retryBehavior: rb.NeverRetry(),
retryBehavior: NeverRetry(),
),
onResponse: (response) {
return response.maybeWhen(
Expand Down Expand Up @@ -911,11 +909,11 @@ void main() {
);

final response = await buildSubject(
retryBehavior: rb.NeverRetry(),
retryBehavior: NeverRetry(),
).execute<Json, Result<bool, String>>(
const GetRequest(
defaultPath,
retryBehavior: rb.Retry(
retryBehavior: Retry(
maxRetries: 2,
retryInterval: Duration(milliseconds: 100),
),
Expand Down Expand Up @@ -955,11 +953,11 @@ void main() {
);

final response = await buildSubject(
retryBehavior: rb.NeverRetry(),
retryBehavior: NeverRetry(),
).execute<Json, Result<bool, String>>(
GetRequest(
defaultPath,
retryBehavior: rb.Retry(
retryBehavior: Retry(
maxRetries: 2,
retryInterval: Duration(milliseconds: 100),
retryClause: (r) {
Expand Down
Loading