5

I'm trying to develop a Dart package for my Flutter project. It only consists of Dart (so no Flutter) code.

When trying to run my unit tests with Android Studio or IntelliJ I get the following error: Test framework quit unexpectedly In the output window I get the following messages:

Testing started at 21:38 ...
/Users/<user>/development/flutter/bin/cache/dart-sdk/bin/pub run test -r json /Users/<user>/Projects/personal/<project dir>/<project>
Observatory listening on http://127.0.0.1:57505/

Could not find a file named "pubspec.yaml" in "/Users/<user>/.pub-cache/hosted/pub.dartlang.org/test-1.5.3".

Process finished with exit code 66

The whole .pub-cache directory doesn't even exists...

How do I get the testing to work?

1
  • Getting this issue too. Commented May 8, 2019 at 23:23

2 Answers 2

3

I had the error messages: "Test framework quit unexpectedly" "The flutter SDK is not available"

The problem was that I configure the unit tests as Dart tests.

Solution in InteliJ: Run > Edit Configurations... > + symbol on the top left > Flutter Test (to use the Flutter template instead of the Dart template)

Test scope: All in Directory and choose your_project/lib folder. This will search for all files named as *_test.dart

This thread helped figuring this out: dart:ui:1: Error: Not found: dart:ui. flutter/dart:

Sign up to request clarification or add additional context in comments.

Comments

0

I've downloaded the separate Dart SDK en configured Android Studio and IntelliJ to use it instead of the one that ships with Flutter.

Now the tests are working again.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.