Skip to content

Commit

Permalink
feat: added test for dio (#223)
Browse files Browse the repository at this point in the history
* feat: added test for dio

* feat: added test for dio

* feat: added test for dio

* feat: added test for dio

* feat: added mocked http adapter

* feat: added alice_test, updated alice_dio tests

* feat: added post request test

* feat: added form data tests

* feat: test error

* feat: log in error test

* fix: fixed issue in stats, updated tests

* feat: added tests

* feat: updated metadata

* refactor: general refactor
  • Loading branch information
jhomlala authored Jul 7, 2024
1 parent cb213a7 commit da907e7
Show file tree
Hide file tree
Showing 23 changed files with 998 additions and 8 deletions.
3 changes: 3 additions & 0 deletions packages/alice/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 1.0.0-dev.11
* Fixed issue with invalid count of error calls in stats page.

# 1.0.0-dev.10

* [BREAKING_CHANGE] Removed `maxCallsCount`. To change call count, use `storage` constructor parameter
Expand Down
9 changes: 4 additions & 5 deletions packages/alice/lib/ui/stats/alice_stats_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,10 @@ class AliceStatsPage extends StatelessWidget {

/// Returns count of error requests.
int _getErrorRequests() => _calls
.where(
(AliceHttpCall call) =>
(call.response?.status.gte(400) ?? false) &&
(call.response?.status.lt(600) ?? false),
)
.where((AliceHttpCall call) =>
(call.response?.status.gte(400) ?? false) &&
(call.response?.status.lt(600) ?? false) ||
const [-1, 0].contains(call.response?.status))
.toList()
.length;

Expand Down
2 changes: 1 addition & 1 deletion packages/alice/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: alice
description: Alice is an HTTP Inspector tool which helps debugging http requests. It catches and stores http requests and responses, which can be viewed via simple UI.
version: 1.0.0-dev.10
version: 1.0.0-dev.11
homepage: https://github.com/jhomlala/alice
repository: https://github.com/jhomlala/alice
topics:
Expand Down
3 changes: 3 additions & 0 deletions packages/alice_dio/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 1.0.5
* Added tests.

# 1.0.4

* Untrack gitignored files.
Expand Down
1 change: 1 addition & 0 deletions packages/alice_dio/lib/alice_dio_adapter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class AliceDioAdapter extends InterceptorsWrapper with AliceAdapter {
}
request.formDataFields = fields;
}

if (data.files.isNotEmpty == true) {
final files = <AliceFormDataFile>[];
for (var entry in data.files) {
Expand Down
8 changes: 6 additions & 2 deletions packages/alice_dio/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: alice_dio
description: "Alice + Dio integration. It contains plugin for Alice which allows to use Dio package."
version: 1.0.4
version: 1.0.5
repository: https://github.com/jhomlala/alice
homepage: https://github.com/jhomlala/alice
topics:
Expand All @@ -21,4 +21,8 @@ dependencies:
sdk: flutter

dev_dependencies:
flutter_lints: ^4.0.0
flutter_lints: ^4.0.0
test: ^1.25.2
mocktail: ^1.0.4
http_mock_adapter: ^0.6.1
alice_test: ^1.0.0
Loading

0 comments on commit da907e7

Please sign in to comment.