Disable warnings for the dart plugin registrant (#76561)
This commit is contained in:
@@ -1915,6 +1915,7 @@ void main() {
|
||||
'package:app/main.dart',
|
||||
flutterBuild,
|
||||
mainFile,
|
||||
throwOnPluginPubspecError: true,
|
||||
);
|
||||
expect(didGenerate, isTrue);
|
||||
expect(flutterBuild.readAsStringSync(),
|
||||
@@ -2000,6 +2001,7 @@ void main() {
|
||||
'package:app/main.dart',
|
||||
flutterBuild,
|
||||
mainFile,
|
||||
throwOnPluginPubspecError: true,
|
||||
), throwsToolExit(message:
|
||||
'Invalid plugin specification url_launcher_macos.\n'
|
||||
'Invalid "macos" plugin specification.'
|
||||
@@ -2055,6 +2057,7 @@ void main() {
|
||||
'package:app/main.dart',
|
||||
flutterBuild,
|
||||
mainFile,
|
||||
throwOnPluginPubspecError: true,
|
||||
), throwsToolExit(message:
|
||||
'Invalid plugin specification url_launcher_macos.\n'
|
||||
'Cannot find the `flutter.plugin.platforms` key in the `pubspec.yaml` file. '
|
||||
@@ -2066,6 +2069,35 @@ void main() {
|
||||
FileSystem: () => fs,
|
||||
ProcessManager: () => FakeProcessManager.any(),
|
||||
});
|
||||
|
||||
testUsingContext('Does not show error messages if throwOnPluginPubspecError is false', () async {
|
||||
final FileSystem fs = MemoryFileSystem();
|
||||
final Set<String> directDependencies = <String>{
|
||||
'url_launcher_windows',
|
||||
};
|
||||
resolvePlatformImplementation(<Plugin>[
|
||||
Plugin.fromYaml(
|
||||
'url_launcher_windows',
|
||||
'',
|
||||
YamlMap.wrap(<String, dynamic>{
|
||||
'platforms': <String, dynamic>{
|
||||
'windows': <String, dynamic>{
|
||||
'dartPluginClass': 'UrlLauncherPluginWindows',
|
||||
},
|
||||
},
|
||||
}),
|
||||
<String>[],
|
||||
fileSystem: fs,
|
||||
appDependencies: directDependencies,
|
||||
),
|
||||
],
|
||||
throwOnPluginPubspecError: false,
|
||||
);
|
||||
expect(testLogger.errorText, '');
|
||||
}, overrides: <Type, Generator>{
|
||||
FileSystem: () => fs,
|
||||
ProcessManager: () => FakeProcessManager.any(),
|
||||
});
|
||||
});
|
||||
|
||||
group('pubspec', () {
|
||||
|
||||
Reference in New Issue
Block a user