mirror of
https://github.com/flutter/packages.git
synced 2025-06-07 03:48:39 +08:00
[flutter_plugin_tools] Remove global state from tests (#4018)
Eliminates the global test filesystem and global test packages directory, in favor of local versions. This guarantees that each test runs with a clean filesystem state, rather than relying on cleanup. It also simplifies understanding the tests, since everything is done via params and return values instead of needing to know about the magic global variables and which methods mutate them.
This commit is contained in:
@ -43,9 +43,9 @@ void main() {
|
||||
});
|
||||
|
||||
test('pubspec includes all plugins', () async {
|
||||
createFakePlugin('plugina', packagesDirectory: packagesDir);
|
||||
createFakePlugin('pluginb', packagesDirectory: packagesDir);
|
||||
createFakePlugin('pluginc', packagesDirectory: packagesDir);
|
||||
createFakePlugin('plugina', packagesDir);
|
||||
createFakePlugin('pluginb', packagesDir);
|
||||
createFakePlugin('pluginc', packagesDir);
|
||||
|
||||
await runner.run(<String>['all-plugins-app']);
|
||||
final List<String> pubspec =
|
||||
@ -61,9 +61,9 @@ void main() {
|
||||
});
|
||||
|
||||
test('pubspec has overrides for all plugins', () async {
|
||||
createFakePlugin('plugina', packagesDirectory: packagesDir);
|
||||
createFakePlugin('pluginb', packagesDirectory: packagesDir);
|
||||
createFakePlugin('pluginc', packagesDirectory: packagesDir);
|
||||
createFakePlugin('plugina', packagesDir);
|
||||
createFakePlugin('pluginb', packagesDir);
|
||||
createFakePlugin('pluginc', packagesDir);
|
||||
|
||||
await runner.run(<String>['all-plugins-app']);
|
||||
final List<String> pubspec =
|
||||
@ -80,7 +80,7 @@ void main() {
|
||||
});
|
||||
|
||||
test('pubspec is compatible with null-safe app code', () async {
|
||||
createFakePlugin('plugina', packagesDirectory: packagesDir);
|
||||
createFakePlugin('plugina', packagesDir);
|
||||
|
||||
await runner.run(<String>['all-plugins-app']);
|
||||
final String pubspec =
|
||||
|
Reference in New Issue
Block a user