Skip to content

Commit

Permalink
Transfer more tests to shared test project (cfug#2161)
Browse files Browse the repository at this point in the history
This PR transfers some download and header/options tests to the shared
test project and thus enabled them for the Http2 adapter.

### New Pull Request Checklist

- [ ] I have read the
[Documentation](https://pub.dev/documentation/dio/latest/)
- [ ] I have searched for a similar pull request in the
[project](https://github.com/cfug/dio/pulls) and found none
- [ ] I have updated this branch with the latest `main` branch to avoid
conflicts (via merge from master or rebase)
- [ ] I have added the required tests to prove the fix/feature I'm
adding
- [ ] I have updated the documentation (if necessary)
- [ ] I have run the tests without failures
- [ ] I have updated the `CHANGELOG.md` in the corresponding package

### Additional context and info (if any)

<!-- Provide more context and info about the PR. -->
  • Loading branch information
kuhnroyal authored Apr 1, 2024
1 parent e7aca5e commit 1c2843a
Show file tree
Hide file tree
Showing 16 changed files with 703 additions and 577 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
run: melos run httpbun:local
- name: '[Verify step] Test Dart packages [VM]'
run: melos run test:vm
- name: Use httpbun.com for VM/Flutter tests
- name: Use httpbun.com for Web/Flutter tests
run: melos run httpbun:com
- name: '[Verify step] Test Dart packages [Chrome]'
run: melos run test:web:chrome
Expand Down
2 changes: 1 addition & 1 deletion dio/dart_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ override_platforms:
arguments: --headless
executable:
# https://github.com/dart-lang/test/pull/2195
mac_os: '/Applications/Firefox.app/Contents/MacOS/firefox'
mac_os: '/Applications/Firefox.app/Contents/MacOS/firefox'
24 changes: 0 additions & 24 deletions dio/test/basic_test.dart

This file was deleted.

15 changes: 9 additions & 6 deletions dio/test/cancel_token_test.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:dio/dio.dart';
import 'package:dio/src/adapters/io_adapter.dart';
import 'package:dio_test/util.dart';
import 'package:mockito/mockito.dart';
import 'package:test/test.dart';

Expand Down Expand Up @@ -60,16 +61,18 @@ void main() {
for (final future in futures) {
expectLater(
future,
throwsA(
(error) =>
error is DioException &&
error.type == DioExceptionType.cancel &&
error.error == reason,
throwsDioException(
DioExceptionType.cancel,
matcher: isA<DioException>().having(
(e) => e.error,
'error',
reason,
),
),
);
}

await Future.delayed(const Duration(milliseconds: 50));
await Future.delayed(const Duration(milliseconds: 100));
token.cancel(reason);

expect(requests, hasLength(2));
Expand Down
231 changes: 0 additions & 231 deletions dio/test/download_test.dart

This file was deleted.

Binary file removed dio/test/mock/flutter.png
Binary file not shown.
Loading

0 comments on commit 1c2843a

Please sign in to comment.