0
votes

I have unit tests in my Flutter project. The problem is VS Code doesn't highlight compilation errors in test files as it does in all other dart files. It just prints errors to debug console.

This is how compilation error looks like in plain dart code file:

enter image description here

This is how compilation error looks like in test file:

enter image description here

Here is my test tab after tests run, chart_bloc_test.dart contains compilation errors:

enter image description here

Flutter version: Flutter (Channel stable, 1.22.0, on Mac OS X 10.15.7 19H2, locale ru-RU).

VS Code version: Version: 1.50.0

Question:

What should I do to make compile time errors be highlighted in test files? Is it VS Code or Flutter or Dart bug?

2

2 Answers

1
votes

Problem solved. It is because of my analysis_options.yaml excluded /test folder...

0
votes

Do your tests live in the test directory under the project root and do they end in _test.dart?