@@ -8,6 +8,7 @@ const sessionsCommand = vi.fn();
88const sessionsCleanupCommand = vi . fn ( ) ;
99const tasksListCommand = vi . fn ( ) ;
1010const tasksAuditCommand = vi . fn ( ) ;
11+ const tasksMaintenanceCommand = vi . fn ( ) ;
1112const tasksShowCommand = vi . fn ( ) ;
1213const tasksNotifyCommand = vi . fn ( ) ;
1314const tasksCancelCommand = vi . fn ( ) ;
@@ -34,6 +35,7 @@ vi.mock("../../commands/sessions-cleanup.js", () => ({
3435vi . mock ( "../../commands/tasks.js" , ( ) => ( {
3536 tasksListCommand,
3637 tasksAuditCommand,
38+ tasksMaintenanceCommand,
3739 tasksShowCommand,
3840 tasksNotifyCommand,
3941 tasksCancelCommand,
@@ -70,6 +72,7 @@ describe("registerStatusHealthSessionsCommands", () => {
7072 sessionsCleanupCommand . mockResolvedValue ( undefined ) ;
7173 tasksListCommand . mockResolvedValue ( undefined ) ;
7274 tasksAuditCommand . mockResolvedValue ( undefined ) ;
75+ tasksMaintenanceCommand . mockResolvedValue ( undefined ) ;
7376 tasksShowCommand . mockResolvedValue ( undefined ) ;
7477 tasksNotifyCommand . mockResolvedValue ( undefined ) ;
7578 tasksCancelCommand . mockResolvedValue ( undefined ) ;
@@ -245,6 +248,18 @@ describe("registerStatusHealthSessionsCommands", () => {
245248 ) ;
246249 } ) ;
247250
251+ it ( "runs tasks maintenance subcommand with apply forwarding" , async ( ) => {
252+ await runCli ( [ "tasks" , "--json" , "maintenance" , "--apply" ] ) ;
253+
254+ expect ( tasksMaintenanceCommand ) . toHaveBeenCalledWith (
255+ expect . objectContaining ( {
256+ json : true ,
257+ apply : true ,
258+ } ) ,
259+ runtime ,
260+ ) ;
261+ } ) ;
262+
248263 it ( "runs tasks audit subcommand with filters" , async ( ) => {
249264 await runCli ( [
250265 "tasks" ,
0 commit comments