Skip to content

Commit 27bfd5d

Browse files
committed
fix(reporters): fix quiet mode
# Conflicts: # test/integration/quiet-mode.test.ts
1 parent 1659fd3 commit 27bfd5d

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

src/reporters/csv.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,10 +360,8 @@ export class CsvReporter extends BaseReporter {
360360
* Write CSV content to stdout
361361
*/
362362
private writeToStdout(csvContent: string): void {
363-
if (this.quiet) {
364-
return;
365-
}
366-
363+
// Always write to stdout when no output path is specified
364+
// The quiet flag only affects progress messages (stderr), not data output
367365
console.log(csvContent);
368366
}
369367
}

test/integration/quiet-mode.test.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,10 @@ export default {
116116
testDir,
117117
);
118118

119+
// JSON output should still go to stdout (data output)
120+
// even in quiet mode when no --output is specified
119121
expect(result.stdout, 'not to be empty');
122+
expect(result.stdout, 'to match', /"meta":/);
120123
expect(result.stderr, 'to be empty');
121124
expect(result.exitCode, 'to equal', 0);
122125
});
@@ -135,7 +138,10 @@ export default {
135138
testDir,
136139
);
137140

138-
expect(result.stdout, 'to be empty');
141+
// CSV output should still go to stdout (data output)
142+
// even in quiet mode when no --output is specified
143+
expect(result.stdout.length, 'to be greater than', 0);
144+
expect(result.stdout, 'to contain', 'file');
139145
expect(result.stderr, 'to be empty');
140146
expect(result.exitCode, 'to equal', 0);
141147
});
@@ -154,7 +160,11 @@ export default {
154160
testDir,
155161
);
156162

163+
// Data reporters (JSON/CSV) should output to stdout
164+
// even in quiet mode when no --output is specified
157165
expect(result.stdout, 'not to be empty');
166+
// JSON output should be present
167+
expect(result.stdout, 'to match', /"meta":/);
158168
expect(result.stderr, 'to be empty');
159169
expect(result.exitCode, 'to equal', 0);
160170
});

test/integration/symlink-install.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ export default {
109109
expect(stdout, 'to contain', 'run');
110110
expect(stdout, 'to contain', 'history');
111111
expect(stdout, 'to contain', 'init');
112-
expect(stdout, 'to contain', 'validate');
113112
});
114113

115114
it('should run benchmarks when executed via symlink', async () => {

0 commit comments

Comments
 (0)