Skip to content

Terrible diagnostics when missing flutter_test dependency  #6187

@emshack

Description

@emshack

Steps to Reproduce

I'm trying to follow the directions on flutter.io to run Flutter unit tests, but I'm having problems with the 'flutter test' command. If I copy over the following file exactly, and then try to test it with flutter test, it fails. Also, all of my dart tests which work using the 'pub run test' command fail on 'flutter test' with the same error. I tried upgrading flutter to the newest version, but still got the same error.

import 'package:test/test.dart';

void main() {
  test('this is a unit test', () {
    expect(42, 42);
  });
}

Flutter Doctor

[✓] Flutter (on Mac OS, channel master)
    • Flutter at /Users/emshack/flutter
    • Framework revision 596637ade4 (33 minutes ago), 2016-10-03 16:08:15
    • Engine revision 71f2871f00
    • Tools Dart version 1.20.0-dev.5.0

[✓] Android toolchain - develop for Android devices (Android SDK 23.0.2)
    • Android SDK at /Users/emshack/Library/Android/sdk
    • Platform android-23, build-tools 23.0.2
    • Java(TM) SE Runtime Environment (build 1.8.0_60-b27)

[✓] iOS toolchain - develop for iOS devices (Xcode 7.3.1)
    • XCode at /Applications/Xcode.app/Contents/Developer
    • Xcode 7.3.1, Build version 7D1014
    x ideviceinstaller not available; this is used to discover connected iOS devices.
      Install via 'brew install ideviceinstaller'.
    x ios-deploy not available; this is used to deploy to connected iOS devices.
      Install via 'brew install ios-deploy'.

[✓] Atom - a lightweight development environment for Flutter
    • flutter plugin version 0.2.5
    • dartlang plugin version 0.6.39

[✓] Connected devices
    • None

Logs and Crash Reports

flutter test lib/test/
00:00 +0 -1: loading [app directory]/lib/test/flutter_layout_test.dart 
  Failed to load "[app directory]/lib/test/flutter_test/flutter_layout_test.dart": Failed assertion: boolean expression must not be null
  package:test                                         test
  lib/test/flutter_test/flutter_layout_test.dart 4:3  main
  dart:async                                           _StreamController.add
  websocket_impl.dart 1111                             _WebSocketImpl._WebSocketImpl._fromSocket.<fn>
  dart:async                                           _EventSinkWrapper.add
  websocket_impl.dart 333                              _WebSocketProtocolTransformer._messageFrameEnd
  websocket_impl.dart 228                              _WebSocketProtocolTransformer.add

Metadata

Metadata

Assignees

Labels

a: tests"flutter test", flutter_test, or one of our teststoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions