Expose new pub outdated command (#53251)
This commit is contained in:
parent
611246ae6a
commit
29913c9011
@ -26,6 +26,7 @@ class PackagesCommand extends FlutterCommand {
|
|||||||
addSubcommand(PackagesForwardCommand('version', 'Print Pub version'));
|
addSubcommand(PackagesForwardCommand('version', 'Print Pub version'));
|
||||||
addSubcommand(PackagesForwardCommand('uploader', 'Manage uploaders for a package on pub.dev'));
|
addSubcommand(PackagesForwardCommand('uploader', 'Manage uploaders for a package on pub.dev'));
|
||||||
addSubcommand(PackagesForwardCommand('global', 'Work with Pub global packages'));
|
addSubcommand(PackagesForwardCommand('global', 'Work with Pub global packages'));
|
||||||
|
addSubcommand(PackagesForwardCommand('outdated', 'Analyze dependencies to find which ones can be upgraded', requiresPubspec: true));
|
||||||
addSubcommand(PackagesPassthroughCommand());
|
addSubcommand(PackagesPassthroughCommand());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -520,5 +520,18 @@ void main() {
|
|||||||
BotDetector: () => const AlwaysTrueBotDetector(),
|
BotDetector: () => const AlwaysTrueBotDetector(),
|
||||||
Pub: () => const Pub(),
|
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(),
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user