Skip to content

Commit 092824c

Browse files
refactor json reporter
1 parent 8d16512 commit 092824c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/reporters/json.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,11 @@ function JSONReporter(runner, options = {}) {
8181
var optionsIndentSize;
8282
if (options.reporterOption && 'indentSize' in options.reporterOption) {
8383
optionsIndentSize = options.reporterOption.indentSize;
84+
} else {
85+
optionsIndentSize = 2; // Default Indentation size
8486
}
85-
var indentSize = parseInt(optionsIndentSize, 10) || 2; // Cast string to int or default indentation
87+
88+
var indentSize = parseInt(optionsIndentSize, 10); // Cast string to int
8689

8790
var json = JSON.stringify(obj, null, indentSize);
8891
if (output) {

0 commit comments

Comments
 (0)