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/articles/documentation/extending-testcafe/reporter-plugin/README.md
+2
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,8 @@ To create a reporter plugin, go through the following steps.
21
21
*[Using the Reporter Development Version](#using-the-reporter-development-version)
22
22
*[Publishing the Reporter to npm](#publishing-the-reporter-to-npm)
23
23
24
+
> You can also specify a reporter object in the [TestCafe programming interface](../../using-testcafe/programming-interface/runner.md#specifying-a-custom-reporter). However, a reporter plugin is easier to reuse and maintain.
25
+
24
26
## Generating a Reporter Project
25
27
26
28
First, install [Yeoman](http://yeoman.io) and `generator-testcafe-reporter` using [npm](https://www.npmjs.com/).
`name` | String | The name of the [reporter](../common-concepts/reporters.md) to use.
323
+
`name` | String | The name of the [reporter](../common-concepts/reporters.md).
323
324
`output` *(optional)* | String | Writable Stream implementer | The file path where the report is written or the output stream. | `stdout`
325
+
`fn` | A function that [returns a custom reporter object](#specifying-a-custom-reporter).
324
326
325
327
To use a single reporter, specify a reporter name and, optionally, an output target as the second parameter.
326
328
@@ -351,6 +353,30 @@ runner.reporter(['spec', {
351
353
}]);
352
354
```
353
355
356
+
#### Specifying a Custom Reporter
357
+
358
+
You can implement a [custom reporter](../../extending-testcafe/reporter-plugin/README.md) in the code that launches tests. This approach allows you to implement your reporter faster if you need it for a single project or do not want to publish a reporter plugin.
359
+
360
+
Pass a *function* that returns the custom reporter object to the `runner.reporter` method.
0 commit comments