dimanche 20 août 2017

Flutter: how to load file for testing

File can be read from the directory relative to the dart script file, simply as var file = new File('./fixture/contacts.json').

However the file cannot be read flutter test running inside IDE.

Loading as resource (it is not, since I do not want to bundle the test data file in the app) also does not work in test.

What is a good way to read file in flutter (for both command line test and IDE test)?

Running flutter test is very fast. However testing inside Intellij IDE is ver slow, but it can set debug breakpoint and step into and view variables. So both testing is very useful.

Aucun commentaire:

Enregistrer un commentaire