Open dcharkes opened 1 year ago
All our dependencies need to also support these two packages.
package:package_config
does not, but it doesn't use the file system if a loader
argument is provided.Moreover unit tests would need to mock the process output and file system changes. Some interesting cases:
dart pub get
creating a package config file.dart pub deps --json
printing a JSON graph to stdout.build.dart
invocations.
build_output.yaml
files, both valid and invalid ones.Simulating all these things in tests might not be the best thing to do. So it's not clear that this will actually improve the code.
For the context of flutter_tools
it might be best to mock this package instead of all the file system operations and
process calls in tests.
flutter_tools unit tests are split into hermetic and permeable tests.
The hermetic tests mock the file system and process invocations.
The native_assets_builder does not use these abstractions, and will try to read/write the local file system and do process invocations.
This means we cannot write hermetic unit tests for the native assets feature, and that we have to always skip the check for native assets in the hermetic unit tests.