Skip to content

Commit

Permalink
fix: export retry_behavior (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
btrautmann authored Apr 2, 2024
1 parent 66e3c34 commit 59436a6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
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

0 comments on commit 59436a6

Please sign in to comment.