maxlapides · GitHub

As a convention, we are keeping our test files next to our source files instead of in a separate test directory. Now, when we click "Run" above the test in VSCode, it fails:

Could not find an option named "name".
Run 'flutter -h' (or 'flutter <command> -h') for available flutter commands and options.
Exited (64)

You can reproduce this:

  1. Create a new Flutter project
  2. Add a new file lib/main_test.dart:
import 'package:flutter_test/flutter_test.dart';
void main() {
  test('test test', () {
    expect(123, 123);
  });
}
  1. Click "Run" above test
  2. Check Debug Console

Is there any way to get this working? If not, how do you recommend structuring the test directory? We have a very big project and we want to make sure we keep our code organized.

Read the original on github.com ↗