File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -115,19 +115,19 @@ Regular text that should be ignored
115115 expect ( logOutput . some ( line => line . includes ( 'no-tasks' ) && line . includes ( 'No tasks' ) ) ) . toBe ( true ) ;
116116 } ) ;
117117
118- it ( 'should sort changes alphabetically' , async ( ) => {
118+ it ( 'should sort changes alphabetically when sort=name ' , async ( ) => {
119119 const changesDir = path . join ( tempDir , 'openspec' , 'changes' ) ;
120120 await fs . mkdir ( path . join ( changesDir , 'zebra' ) , { recursive : true } ) ;
121121 await fs . mkdir ( path . join ( changesDir , 'alpha' ) , { recursive : true } ) ;
122122 await fs . mkdir ( path . join ( changesDir , 'middle' ) , { recursive : true } ) ;
123123
124124 const listCommand = new ListCommand ( ) ;
125- await listCommand . execute ( tempDir ) ;
125+ await listCommand . execute ( tempDir , 'changes' , { sort : 'name' } ) ;
126126
127- const changeLines = logOutput . filter ( line =>
127+ const changeLines = logOutput . filter ( line =>
128128 line . includes ( 'alpha' ) || line . includes ( 'middle' ) || line . includes ( 'zebra' )
129129 ) ;
130-
130+
131131 expect ( changeLines [ 0 ] ) . toContain ( 'alpha' ) ;
132132 expect ( changeLines [ 1 ] ) . toContain ( 'middle' ) ;
133133 expect ( changeLines [ 2 ] ) . toContain ( 'zebra' ) ;
You can’t perform that action at this time.
0 commit comments