Closed pratamawijaya closed 4 years ago
If someone has the same problem:
it looks like only VSCode can find the file path of the test file.
If you're using a different editor, fix the file fixture_reader.dart
like so:
import 'dart:io';
String fixture(String name) {
var dir = Directory.current.path;
if (dir.endsWith('/test')) {
dir = dir.replaceAll('/test', '');
}
return File('$dir/test/fixtures/$name').readAsStringSync();
}
More information on this GitHub issue.
This is what works for me:
String fixture(String fileName) =>
File('./test/fixtures/$fileName').readAsStringSync();
i'm trying running test with
flutter test
but it show error