Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhnroyal committed Jan 21, 2024
1 parent 997b4ec commit 4449817
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
- name: '[Verify step] Analyze Flutter packages'
run: melos exec $(eval echo $IGNORED_PACKAGES) --flutter -- "flutter analyze --fatal-infos"
- name: '[Verify step] Publish dry-run'
run: melos exec $(eval echo $IGNORED_PACKAGES) --ignore="*example*" --ignore="dio_tests" -- "dart pub publish --dry-run"
run: melos exec $(eval echo $IGNORED_PACKAGES) --ignore="*example*" --ignore="dio_test" -- "dart pub publish --dry-run"
- name: '[Verify step] Test Dart packages [VM]'
run: melos exec $(eval echo $IGNORED_PACKAGES) --ignore="*example*" --no-flutter -- "MELOS_ROOT_PATH/scripts/dart_test.sh --platform=vm"
- name: '[Verify step] Test Dart packages [Chrome]'
Expand Down
4 changes: 2 additions & 2 deletions dio/test/basic_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import 'dart:async';
import 'dart:io';

import 'package:dio/dio.dart';
import 'package:dio/src/utils.dart';
import 'package:test/test.dart';

import 'mock/adapters.dart';
import 'utils.dart';

void main() {
test('send with an invalid URL', () async {
Expand All @@ -15,7 +15,7 @@ void main() {
allOf([
isA<DioException>(),
(DioException e) => e.type == (DioExceptionType.connectionError),
if (!isWeb) (DioException e) => e.error is SocketException,
if (!kIsWeb) (DioException e) => e.error is SocketException,
]),
),
);
Expand Down
3 changes: 1 addition & 2 deletions dio/test/cors_tests.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import 'package:dio/dio.dart';
import 'package:dio_test/util.dart';
import 'package:test/test.dart';

import '../../dio_test/lib/src/matcher.dart';

// Test that browsers can correctly classify requests as
// either "simple" or "preflighted". Reference:
// https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#simple_requests
Expand Down
2 changes: 0 additions & 2 deletions dio_test/lib/src/test/parameter_tests.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import 'package:dio/dio.dart';
import 'package:test/test.dart';

import '../utils.dart';

void parameterTests(
Dio Function() create,
) {
Expand Down
4 changes: 2 additions & 2 deletions dio_test/lib/src/test/redirect_tests.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void redirectTests(
);
expect(response.isRedirect, isTrue);

if (!isWeb) {
if (!kIsWeb) {
// Redirects are not supported in web.
// Rhe browser will follow the redirects automatically.
expect(response.redirects.length, 1);
Expand All @@ -40,7 +40,7 @@ void redirectTests(
);
expect(response.isRedirect, isTrue);

if (!isWeb) {
if (!kIsWeb) {
// Redirects are not supported in web.
// The browser will follow the redirects automatically.
expect(response.redirects.length, 3);
Expand Down
2 changes: 1 addition & 1 deletion dio_test/lib/src/utils.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const isWeb = bool.hasEnvironment('dart.library.js_util')
const kIsWeb = bool.hasEnvironment('dart.library.js_util')
? bool.fromEnvironment('dart.library.js_util')
: identical(0, 0.0);

0 comments on commit 4449817

Please sign in to comment.