Testing - adventures-in/chat_app GitHub Wiki

Integration Tests

Running the emulators

firebase emulators:start --import=test/data

The Firebase Local Emulator Suite lets the app to connect to a local, emulated version of the Firestore and Cloud Functions, so that you can prototype and test without affecting the live Firestore, and restart from the default data at any time.

With the Firebase CLI installed, start the emulators with:

firebase emulators:start --import=test/data

The app needs to be run with the alternative entry point lib/main_local.dart

  • already set as a VSCode launch option
  • if someone could add a note on how to do this with AS that would be awesome

If you want your changes become the new default, in another terminal enter:

firebase emulators:export ./test/data

Notes:

  • Any service that is not emulated (eg. Auth, Storage) uses the live version

References

Flutter - Official Documentation

Testing Flutter apps - Flutter

Flutter Libs

Dart

Dart testing | Dart

Packages