How to find if we are running unit test in Dart (Flutter) How to find if we are running unit test in Dart (Flutter) flutter flutter

How to find if we are running unit test in Dart (Flutter)


You can use the following to check if you're running a test.

Platform.environment.containsKey('FLUTTER_TEST')