In those questions:
- How to find if we are running unit test in Dart (Flutter)
- Check if App is running in a Testing Environment
The given solution is to use
Platform.environment.containsKey('FLUTTER_TEST')
but Platform comes from dart:io which is not supported on web.
If I import it from universal_io, it returns false when I run the tests with
flutter test --platform chrome
How to get a similar method/variable in a web environment?