Skip to content

Commit ac8ee61

Browse files
authored
docs: all hooks are optional in the Reporter interface (#14435)
1 parent 73c91be commit ac8ee61

File tree

4 files changed

+28
-4
lines changed

4 files changed

+28
-4
lines changed

docs/Configuration.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1401,7 +1401,7 @@ Hungry for reporters? Take a look at long list of [awesome reporters](https://gi
14011401

14021402
:::
14031403

1404-
Custom reporter module must export a class that takes [`globalConfig`](https://github.com/jestjs/jest/blob/v29.2.1/packages/jest-types/src/Config.ts#L358-L422), `reporterOptions` and `reporterContext` as constructor arguments and implements at least `onRunComplete()` method (for the full list of methods and argument types see `Reporter` interface in [packages/jest-reporters/src/types.ts](https://github.com/jestjs/jest/blob/main/packages/jest-reporters/src/types.ts)):
1404+
Custom reporter module must export a class that takes [`globalConfig`](https://github.com/jestjs/jest/blob/v29.2.1/packages/jest-types/src/Config.ts#L358-L422), `reporterOptions` and `reporterContext` as constructor arguments:
14051405

14061406
```js title="custom-reporter.js"
14071407
class CustomReporter {
@@ -1430,6 +1430,12 @@ class CustomReporter {
14301430
module.exports = CustomReporter;
14311431
```
14321432

1433+
:::note
1434+
1435+
For the full list of hooks and argument types see the `Reporter` interface in [packages/jest-reporters/src/types.ts](https://github.com/jestjs/jest/blob/main/packages/jest-reporters/src/types.ts).
1436+
1437+
:::
1438+
14331439
### `resetMocks` \[boolean]
14341440

14351441
Default: `false`

website/versioned_docs/version-29.4/Configuration.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1330,7 +1330,7 @@ Hungry for reporters? Take a look at long list of [awesome reporters](https://gi
13301330

13311331
:::
13321332

1333-
Custom reporter module must export a class that takes [`globalConfig`](https://github.com/jestjs/jest/blob/v29.2.1/packages/jest-types/src/Config.ts#L358-L422), `reporterOptions` and `reporterContext` as constructor arguments and implements at least `onRunComplete()` method (for the full list of methods and argument types see `Reporter` interface in [packages/jest-reporters/src/types.ts](https://github.com/jestjs/jest/blob/main/packages/jest-reporters/src/types.ts)):
1333+
Custom reporter module must export a class that takes [`globalConfig`](https://github.com/jestjs/jest/blob/v29.2.1/packages/jest-types/src/Config.ts#L358-L422), `reporterOptions` and `reporterContext` as constructor arguments:
13341334

13351335
```js title="custom-reporter.js"
13361336
class CustomReporter {
@@ -1359,6 +1359,12 @@ class CustomReporter {
13591359
module.exports = CustomReporter;
13601360
```
13611361

1362+
:::note
1363+
1364+
For the full list of hooks and argument types see the `Reporter` interface in [packages/jest-reporters/src/types.ts](https://github.com/jestjs/jest/blob/main/packages/jest-reporters/src/types.ts).
1365+
1366+
:::
1367+
13621368
### `resetMocks` \[boolean]
13631369

13641370
Default: `false`

website/versioned_docs/version-29.5/Configuration.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1365,7 +1365,7 @@ Hungry for reporters? Take a look at long list of [awesome reporters](https://gi
13651365

13661366
:::
13671367

1368-
Custom reporter module must export a class that takes [`globalConfig`](https://github.com/jestjs/jest/blob/v29.2.1/packages/jest-types/src/Config.ts#L358-L422), `reporterOptions` and `reporterContext` as constructor arguments and implements at least `onRunComplete()` method (for the full list of methods and argument types see `Reporter` interface in [packages/jest-reporters/src/types.ts](https://github.com/jestjs/jest/blob/main/packages/jest-reporters/src/types.ts)):
1368+
Custom reporter module must export a class that takes [`globalConfig`](https://github.com/jestjs/jest/blob/v29.2.1/packages/jest-types/src/Config.ts#L358-L422), `reporterOptions` and `reporterContext` as constructor arguments:
13691369

13701370
```js title="custom-reporter.js"
13711371
class CustomReporter {
@@ -1394,6 +1394,12 @@ class CustomReporter {
13941394
module.exports = CustomReporter;
13951395
```
13961396

1397+
:::note
1398+
1399+
For the full list of hooks and argument types see the `Reporter` interface in [packages/jest-reporters/src/types.ts](https://github.com/jestjs/jest/blob/main/packages/jest-reporters/src/types.ts).
1400+
1401+
:::
1402+
13971403
### `resetMocks` \[boolean]
13981404

13991405
Default: `false`

website/versioned_docs/version-29.6/Configuration.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1401,7 +1401,7 @@ Hungry for reporters? Take a look at long list of [awesome reporters](https://gi
14011401

14021402
:::
14031403

1404-
Custom reporter module must export a class that takes [`globalConfig`](https://github.com/jestjs/jest/blob/v29.2.1/packages/jest-types/src/Config.ts#L358-L422), `reporterOptions` and `reporterContext` as constructor arguments and implements at least `onRunComplete()` method (for the full list of methods and argument types see `Reporter` interface in [packages/jest-reporters/src/types.ts](https://github.com/jestjs/jest/blob/main/packages/jest-reporters/src/types.ts)):
1404+
Custom reporter module must export a class that takes [`globalConfig`](https://github.com/jestjs/jest/blob/v29.2.1/packages/jest-types/src/Config.ts#L358-L422), `reporterOptions` and `reporterContext` as constructor arguments:
14051405

14061406
```js title="custom-reporter.js"
14071407
class CustomReporter {
@@ -1430,6 +1430,12 @@ class CustomReporter {
14301430
module.exports = CustomReporter;
14311431
```
14321432

1433+
:::note
1434+
1435+
For the full list of hooks and argument types see the `Reporter` interface in [packages/jest-reporters/src/types.ts](https://github.com/jestjs/jest/blob/main/packages/jest-reporters/src/types.ts).
1436+
1437+
:::
1438+
14331439
### `resetMocks` \[boolean]
14341440

14351441
Default: `false`

0 commit comments

Comments
 (0)