Expose new pub outdated command (#53251)

This commit is contained in:
Michael Thomsen
2020-03-25 19:21:03 +01:00
committed by GitHub
parent 611246ae6a
commit 29913c9011
2 changed files with 14 additions and 0 deletions

View File

@@ -26,6 +26,7 @@ class PackagesCommand extends FlutterCommand {
addSubcommand(PackagesForwardCommand('version', 'Print Pub version'));
addSubcommand(PackagesForwardCommand('uploader', 'Manage uploaders for a package on pub.dev'));
addSubcommand(PackagesForwardCommand('global', 'Work with Pub global packages'));
addSubcommand(PackagesForwardCommand('outdated', 'Analyze dependencies to find which ones can be upgraded', requiresPubspec: true));
addSubcommand(PackagesPassthroughCommand());
}

View File

@@ -520,5 +520,18 @@ void main() {
BotDetector: () => const AlwaysTrueBotDetector(),
Pub: () => const Pub(),
});
testUsingContext('outdated', () async {
await createTestCommandRunner(PackagesCommand()).run(<String>['packages', 'outdated']);
final List<String> commands = mockProcessManager.commands;
expect(commands, hasLength(2));
expect(commands[0], matches(r'dart-sdk[\\/]bin[\\/]pub'));
expect(commands[1], 'outdated');
}, overrides: <Type, Generator>{
ProcessManager: () => mockProcessManager,
Stdio: () => mockStdio,
BotDetector: () => const AlwaysTrueBotDetector(),
Pub: () => const Pub(),
});
});
}