I'm using flutter "path_provider" plugin. I needed an SQLite operation. My error test class doesn't find "getApplicationDocumentsDirectory" and return null. The application runs for simulator/real device any working no problem.
Looking for provider repository and test folder.I've tired test class example but the error persists.
const MethodChannel channel =
MethodChannel('plugins.flutter.io/path_provider');
channel.setMockMethodCallHandler((MethodCall methodCall) async {
log.add(methodCall);
return response;
});
test('user save data', () async {
var response = null;
//FIXME : directory return null
final Directory directory = await getApplicationDocumentsDirectory();
final model = UserWordInformation();
model.word = word;
model.know = 1;
final result = await dbHelper.insert(model.toMap());
expect(result, 1);
});
I expect return path folder for the device.Some path : "/Users/vb/Library/Developer/CoreSimulator/Devices/C5B3C94C-C774-4D0E-A19C-97AAF11BD9E3/data/Containers/Data/Application/0508712B-A138-483A-921E-B5EAE6DF149F/Documents"