Skip to content

Issues Found When We ran Flutter unit tests #184

@manoj1749

Description

@manoj1749
  • Some tests failed when flutter unit tests for the rutorrent-flutter application.
  • These issues were found due to the modal_bottom_sheet dependency used.
  • We can run flutter test in the local directory of the project to reproduce the issue.

Issues found

00:01 +0: ...Users/manoj/Downloads/rutorrent-flutter-main/test/service_tests/api_service_test.dart     ../../.pub-cache/hosted/pub.dev/modal_bottom_sheet-2.1.0/lib/src/material_with_modal_page_route.dart:4:1
: Error: 'ModalBottomSheetRoute' is imported from both 'package:flutter/src/material/bottom_sheet.dart'
and 'package:modal_bottom_sheet/src/bottom_sheet_route.dart'.
import '../modal_bottom_sheet.dart';
^^^^^^^^^^^^^^^^^^^^^
00:04 +0: ...Users/manoj/Downloads/rutorrent-flutter-main/test/service_tests/api_service_test.dart     ../../.pub-cache/hosted/pub.dev/modal_bottom_sheet-2.1.0/lib/src/bottom_sheets/material_bottom_sheet.dar
t:28:13: Error: 'ModalBottomSheetRoute' is imported from both
'package:flutter/src/material/bottom_sheet.dart' and
'package:modal_bottom_sheet/src/bottom_sheet_route.dart'.
      .push(ModalBottomSheetRoute<T>(
            ^^^^^^^^^^^^^^^^^^^^^
../../.pub-cache/hosted/pub.dev/modal_bottom_sheet-2.1.0/lib/src/bottom_sheets/material_bottom_sheet.dar
t:50:10: Error: A value of type 'Object?' can't be returned from an async function with return type
'Future<T?>'.
 - 'Object' is from 'dart:core'.
 - 'Future' is from 'dart:async'.
  return result;
         ^
../../.pub-cache/hosted/pub.dev/modal_bottom_sheet-2.1.0/lib/src/bottom_sheets/bar_bottom_sheet.dart:99:
13: Error: 'ModalBottomSheetRoute' is imported from both
'package:flutter/src/material/bottom_sheet.dart' and
'package:modal_bottom_sheet/src/bottom_sheet_route.dart'.
      .push(ModalBottomSheetRoute<T>(
            ^^^^^^^^^^^^^^^^^^^^^
../../.pub-cache/hosted/pub.dev/modal_bottom_sheet-2.1.0/lib/src/bottom_sheets/bar_bottom_sheet.dart:121
:10: Error: A value of type 'Object?' can't be returned from an async function with return type
'Future<T?>'.
 - 'Object' is from 'dart:core'.
 - 'Future' is from 'dart:async'.
  return result;
         ^
00:06 +0 -1: loading /Users/manoj/Downloads/rutorrent-flutter-main/test/service_tests/api_service_test.dart [E]
  Failed to load "/Users/manoj/Downloads/rutorrent-flutter-main/test/service_tests/api_service_test.dart": Compilation failed for testPath=/Users/manoj/Downloads/rutorrent-flutter-main/test/service_tests/api_service_test.dart

To run this test again: /Users/manoj/flutter/bin/cache/dart-sdk/bin/dart test /Users/manoj/Downloads/rutorrent-flutter-main/test/service_tests/api_service_test.dart -p vm --plain-name 'loading /Users/manoj/Downloads/rutorrent-flutter-main/test/service_tests/api_service_test.dart'
  Exception: the Dart compiler exited unexpectedly.
  package:flutter_tools/src/base/common.dart 10:3  throwToolExit
  package:flutter_tools/src/compile.dart 831:9     DefaultResidentCompiler._compile.<fn>
  dart:async/zone.dart 1406:47                     _rootRunUnary
  dart:async/zone.dart 1307:19                     _CustomZone.runUnary
  
00:11 +1 -1: Some tests failed.                                            

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions