You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
[path_provider] Updated documentation reflecting changes needed for testing (#2815)
The recent federation of the Linux path provider might break tests, this updates the README.md to address those changes and direct the users how to mock the plugin in their tests.
Please see the example app of this plugin for a full example.
23
+
24
+
### Usage in tests
25
+
26
+
`path_provider` now uses a `PlatformInterface`, meaning that not all platforms share the a single `PlatformChannel`-based implementation.
27
+
With that change, tests should be updated to mock `PathProviderPlatform` rather than `PlatformChannel`.
28
+
29
+
See this `path_provider`[test](https://github.com/flutter/plugins/blob/master/packages/path_provider/path_provider/test/path_provider_test.dart) for an example.
30
+
31
+
You will also have to temporarily add the following line to the setup of your test.
32
+
```dart
33
+
disablePathProviderPlatformOverride = true;
34
+
```
35
+
36
+
See this [issue](https://github.com/flutter/flutter/issues/52267), for more details on why this is needed.
0 commit comments