File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -116,6 +116,26 @@ export default testSuite(({ describe }) => {
116116 expect ( stripVTControlCharacters ( result . output ) . includes ( 'some output text' ) ) . toBe ( true ) ;
117117 } ) ;
118118
119+ test ( 'task with multi-line output indents each line' , async ( ) => {
120+ await using fixture = await createFixture ( {
121+ 'test.mjs' : `
122+ import task from '#tasuku';
123+
124+ await task('Task with multi-line output', async ({ setOutput }) => {
125+ setOutput('line 1\\nline 2\\nline 3');
126+ });
127+ ` ,
128+ } , { tempDir } ) ;
129+
130+ const result = await node ( fixture . getPath ( 'test.mjs' ) ) ;
131+ const textOutput = stripVTControlCharacters ( result . output ) ;
132+
133+ // All output lines should be indented at the same level (2 spaces)
134+ expect ( textOutput ) . toMatch ( / ^ → l i n e 1 $ / m) ;
135+ expect ( textOutput ) . toMatch ( / ^ l i n e 2 $ / m) ;
136+ expect ( textOutput ) . toMatch ( / ^ l i n e 3 $ / m) ;
137+ } ) ;
138+
119139 test ( 'nested tasks are indented' , async ( ) => {
120140 await using fixture = await createFixture ( {
121141 'test.mjs' : `
You can’t perform that action at this time.
0 commit comments