Skip to content

Commit 0475573

Browse files
committed
test: assert multiline indentation
1 parent adfc8ae commit 0475573

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/specs/renderer-states.spec.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff 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(/^ line 1$/m);
135+
expect(textOutput).toMatch(/^ line 2$/m);
136+
expect(textOutput).toMatch(/^ line 3$/m);
137+
});
138+
119139
test('nested tasks are indented', async () => {
120140
await using fixture = await createFixture({
121141
'test.mjs': `

0 commit comments

Comments
 (0)