@@ -25,6 +25,8 @@ define.staged({ '*.txt': 'node revert.mjs' });
2525for (const file of process.argv.slice(2)) {
2626 writeFileSync(file, 'initial\\n');
2727}
28+
29+ console.log('staged task output');
2830` ,
2931 ) ,
3032 writeFile ( path . join ( cwd , 'file.txt' ) , 'initial\n' ) ,
@@ -66,6 +68,7 @@ test('should display the staged help message', ({ execCli, expect }) => {
6668 expect ( output ) . toContain ( 'Usage:\n $ rs staged [options]' ) ;
6769 expect ( output ) . toContain ( 'Runs lint-staged with tasks from define.staged in rstack.config.' ) ;
6870 expect ( output ) . toContain ( '--allow-empty' ) ;
71+ expect ( output ) . toContain ( '-v, --verbose' ) ;
6972 expect ( output ) . toContain ( '-h, --help' ) ;
7073} ) ;
7174
@@ -85,14 +88,19 @@ test('should allow an empty commit with --allow-empty', async ({ execCli }) => {
8588 } ) ;
8689} ) ;
8790
88- test ( 'should run staged tasks with --concurrent false' , async ( { execCli } ) => {
89- await withGitFixture ( ( cwd ) => {
90- execCli ( `staged --allow-empty --concurrent false` , { cwd } ) ;
91+ for ( const option of [ '--concurrent false' , '-p 1' ] ) {
92+ test ( `should run staged tasks with ${ option } ` , async ( { execCli } ) => {
93+ await withGitFixture ( ( cwd ) => {
94+ execCli ( `staged --allow-empty ${ option } ` , { cwd } ) ;
95+ } ) ;
9196 } ) ;
92- } ) ;
97+ }
9398
94- test ( 'should run staged tasks with -p 1' , async ( { execCli } ) => {
95- await withGitFixture ( ( cwd ) => {
96- execCli ( `staged --allow-empty -p 1` , { cwd } ) ;
99+ for ( const option of [ '--verbose' , '-v' ] ) {
100+ test ( `should show successful task output with ${ option } ` , async ( { execCli, expect } ) => {
101+ await withGitFixture ( ( cwd ) => {
102+ const output = execCli ( `staged --allow-empty ${ option } ` , { cwd } ) ;
103+ expect ( output ) . toContain ( 'staged task output' ) ;
104+ } ) ;
97105 } ) ;
98- } ) ;
106+ }
0 commit comments