Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: remove mention that onRunComplete() is required in the Reporter interface #14435

Merged
merged 1 commit into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion docs/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -1401,7 +1401,7 @@ Hungry for reporters? Take a look at long list of [awesome reporters](https://gi

:::

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)):
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:

```js title="custom-reporter.js"
class CustomReporter {
Expand Down Expand Up @@ -1430,6 +1430,12 @@ class CustomReporter {
module.exports = CustomReporter;
```

:::note

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).

:::
Comment on lines +1433 to +1437
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to:

:::note
The definitions above were trimmed down for brevity. Full code can be found in [Jest repo on GitHub](https://github.com/jestjs/jest/blob/main/packages/jest-transform/src/types.ts) (remember to choose the right tag/commit for your version of Jest).
:::


### `resetMocks` \[boolean]

Default: `false`
Expand Down
8 changes: 7 additions & 1 deletion website/versioned_docs/version-29.4/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -1330,7 +1330,7 @@ Hungry for reporters? Take a look at long list of [awesome reporters](https://gi

:::

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)):
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:

```js title="custom-reporter.js"
class CustomReporter {
Expand Down Expand Up @@ -1359,6 +1359,12 @@ class CustomReporter {
module.exports = CustomReporter;
```

:::note

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).

:::

### `resetMocks` \[boolean]

Default: `false`
Expand Down
8 changes: 7 additions & 1 deletion website/versioned_docs/version-29.5/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,7 @@ Hungry for reporters? Take a look at long list of [awesome reporters](https://gi

:::

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)):
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:

```js title="custom-reporter.js"
class CustomReporter {
Expand Down Expand Up @@ -1394,6 +1394,12 @@ class CustomReporter {
module.exports = CustomReporter;
```

:::note

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).

:::

### `resetMocks` \[boolean]

Default: `false`
Expand Down
8 changes: 7 additions & 1 deletion website/versioned_docs/version-29.6/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -1401,7 +1401,7 @@ Hungry for reporters? Take a look at long list of [awesome reporters](https://gi

:::

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)):
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:

```js title="custom-reporter.js"
class CustomReporter {
Expand Down Expand Up @@ -1430,6 +1430,12 @@ class CustomReporter {
module.exports = CustomReporter;
```

:::note

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).

:::

### `resetMocks` \[boolean]

Default: `false`
Expand Down