Skip to content

Commit

Permalink
coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
urusai88 committed Dec 29, 2023
1 parent fb594f1 commit 372e259
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- main
- ga
- coverage

jobs:
build:
Expand Down
3 changes: 3 additions & 0 deletions test/_test_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ class TestTioService extends TioService<MyResponseError> {
Future<MyResponse<List<User>>> postsAsUsers() =>
client.get<User>('/posts').many();

Future<MyResponse<User>> postAsUser(int id) =>
client.get<User>('/posts/$id').one();

Future<MyResponse<List<Todo>>> todos() => client.get<Todo>('/todos').many();

Future<MyResponse<ResponseBody>> todosAsStream() =>
Expand Down
18 changes: 16 additions & 2 deletions test/error_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,27 @@ void main() {
);

test(
'transformation error',
'transformation error many',
() async => expect(
testService.postsAsUsers(),
throwsA(
isA<TioException>().having(
(error) => error.type,
'type must be a middleware',
'type',
equals(TioExceptionType.middleware),
),
),
),
);

test(
'transformation error one',
() async => expect(
testService.postAsUser(1),
throwsA(
isA<TioException>().having(
(error) => error.type,
'type',
equals(TioExceptionType.middleware),
),
),
Expand Down

0 comments on commit 372e259

Please sign in to comment.