You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/formatters.md
+20-3Lines changed: 20 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,11 +34,16 @@ Many formatters, including the built-in ones, support some configuration via opt
34
34
35
35
This option is repeatable, so you can use it multiple times and the objects will be merged with the later ones taking precedence.
36
36
37
-
Some options offered by built-in formatters:
37
+
Some common options supported by built-in formatters:
38
38
39
39
-`colorsEnabled` - [see below](#colored-output)
40
40
-`printAttachments` - if set to `false`, attachments won't be part of progress bars and summary reports
41
41
42
+
Some formatters have options that are only applicable to them. These options will be under a key that matches the formatter name, like this:
43
+
44
+
- In a configuration file `{ formatOptions: { pretty: { featuresAndRules : false } }`
45
+
- On the CLI `cucumber-js --format-options '{"pretty":{"featuresAndRules":false}}'`
46
+
42
47
## Colored output
43
48
44
49
Many formatters, including the built-in ones, emit some colored output. By default, Cucumber will automatically detect the colors support of the output stream and decide whether to emit colors accordingly. This check comes via the [supports-colors](https://github.com/chalk/supports-color) library and is pretty comprehensive, including awareness of commonly-used operating systems and CI platforms that represent edge cases.
@@ -75,7 +80,19 @@ Similar to the Progress Formatter, but provides a real-time updating progress ba
75
80
76
81

77
82
78
-
*Note: the Progress Bar Formatter will only work with a TTY terminal (and not, for example, a file stream).*
83
+
### `pretty`
84
+
85
+
ℹ️ Added in v12.1.0
86
+
ℹ️ Can be installed and referenced as `@cucumber/pretty-formatter` from v11.1.0
87
+
88
+
Writes a rich report of the scenario and example execution as it happens.
89
+
90
+

91
+
92
+
Options specific to this formatter (under the `pretty` key):
93
+
94
+
-`featuresAndRules` - whether to include headings for Features and Rules (defaults to `true`)
95
+
-`theme` - control over the styling of various elements (see [documentation](https://github.com/cucumber/pretty-formatter/blob/main/javascript/README.md#themes))
79
96
80
97
### `html`
81
98
@@ -120,7 +137,7 @@ Outputs details of the test run in the legacy JSON format.
120
137
121
138
The JUnit formatter produces an XML-based report in the standard(ish) [JUnit format](https://github.com/junit-team/junit5/blob/43638eb6a870e0d6c49224053dfeb39dcf0ef33f/platform-tests/src/test/resources/jenkins-junit.xsd). This is most commonly useful for having your CI platform pick up your tests results and factor them into its reporting. Consult your CI platform's docs for where exactly you should output this report to and what the filename should be.
122
139
123
-
Options specific to this formatter:
140
+
Options specific to this formatter (under the `junit` key):
124
141
125
142
-`suiteName` - value to go in the `name` attribute of the `testsuite` element in the output (defaults to `cucumber-js`)
0 commit comments