[flutter_tools] Fix null check in parsing web plugin from pubspec.yaml (#117939)
* fix null check in parsing web plugin yaml * revert accidental diff * remove comment
This commit is contained in:
committed by
GitHub
parent
231855fc87
commit
672fe20bde
@@ -290,6 +290,29 @@ void main() {
|
||||
]);
|
||||
});
|
||||
|
||||
testWithoutContext('Web plugin tool exits if fileName field missing', () {
|
||||
final FileSystem fileSystem = MemoryFileSystem.test();
|
||||
const String pluginYamlRaw =
|
||||
'platforms:\n'
|
||||
' web:\n'
|
||||
' pluginClass: WebSamplePlugin\n';
|
||||
|
||||
final YamlMap pluginYaml = loadYaml(pluginYamlRaw) as YamlMap;
|
||||
expect(
|
||||
() => Plugin.fromYaml(
|
||||
_kTestPluginName,
|
||||
_kTestPluginPath,
|
||||
pluginYaml,
|
||||
null,
|
||||
const <String>[],
|
||||
fileSystem: fileSystem,
|
||||
),
|
||||
throwsToolExit(
|
||||
message: 'The plugin `$_kTestPluginName` is missing the required field `fileName` in pubspec.yaml',
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
testWithoutContext('Windows assumes win32 when no variants are given', () {
|
||||
final FileSystem fileSystem = MemoryFileSystem.test();
|
||||
const String pluginYamlRaw =
|
||||
|
||||
Reference in New Issue
Block a user