Skip to content

Commit

Permalink
docs: add few more missing admonitions (#14100)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrazauskas authored May 2, 2023
1 parent 3a76e40 commit d85d542
Show file tree
Hide file tree
Showing 15 changed files with 55 additions and 25 deletions.
2 changes: 1 addition & 1 deletion docs/SnapshotTesting.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Once you're finished, Jest will give you a summary before returning back to watc

Inline snapshots behave identically to external snapshots (`.snap` files), except the snapshot values are written automatically back into the source code. This means you can get the benefits of automatically generated snapshots without having to switch to an external file to make sure the correct value was written.

**Example:**
Example:

First, you write a test, calling `.toMatchInlineSnapshot()` with no arguments:

Expand Down
12 changes: 10 additions & 2 deletions website/versioned_docs/version-25.x/MockFunctionAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,11 @@ You can see an example of using Jest with TypeScript in our [GitHub repository](

### `jest.MockedFunction`

> `jest.MockedFunction` is available in the `@types/jest` module from version `24.9.0`.
:::tip

`jest.MockedFunction` is available in the `@types/jest` module from version `24.9.0`.

:::

The following examples will assume you have an understanding of how [Jest mock functions work with JavaScript](MockFunctions.md).

Expand Down Expand Up @@ -424,7 +428,11 @@ test('calculate calls add', () => {

### `jest.MockedClass`

> `jest.MockedClass` is available in the `@types/jest` module from version `24.9.0`.
:::tip

`jest.MockedClass` is available in the `@types/jest` module from version `24.9.0`.

:::

The following examples will assume you have an understanding of how [Jest mock classes work with JavaScript](Es6ClassMocks.md).

Expand Down
12 changes: 8 additions & 4 deletions website/versioned_docs/version-25.x/SnapshotTesting.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,15 @@ Once you're finished, Jest will give you a summary before returning back to watc

Inline snapshots behave identically to external snapshots (`.snap` files), except the snapshot values are written automatically back into the source code. This means you can get the benefits of automatically generated snapshots without having to switch to an external file to make sure the correct value was written.

> Inline snapshots are powered by [Prettier](https://prettier.io). To use inline snapshots you must have `prettier` installed in your project. Your Prettier configuration will be respected when writing to test files.
>
> If you have `prettier` installed in a location where Jest can't find it, you can tell Jest how to find it using the [`"prettierPath"`](./Configuration.md#prettierpath-string) configuration property.
:::info

Inline snapshots are powered by [Prettier](https://prettier.io). To use inline snapshots you must have `prettier` installed in your project. Your Prettier configuration will be respected when writing to test files.

If you have `prettier` installed in a location where Jest can't find it, you can tell Jest how to find it using the [`prettierPath`](./Configuration.md#prettierpath-string) configuration property.

:::

**Example:**
Example:

First, you write a test, calling `.toMatchInlineSnapshot()` with no arguments:

Expand Down
12 changes: 10 additions & 2 deletions website/versioned_docs/version-26.x/MockFunctionAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,11 @@ You can see an example of using Jest with TypeScript in our [GitHub repository](

### `jest.MockedFunction`

> `jest.MockedFunction` is available in the `@types/jest` module from version `24.9.0`.
:::tip

`jest.MockedFunction` is available in the `@types/jest` module from version `24.9.0`.

:::

The following examples will assume you have an understanding of how [Jest mock functions work with JavaScript](MockFunctions.md).

Expand Down Expand Up @@ -424,7 +428,11 @@ test('calculate calls add', () => {

### `jest.MockedClass`

> `jest.MockedClass` is available in the `@types/jest` module from version `24.9.0`.
:::tip

`jest.MockedClass` is available in the `@types/jest` module from version `24.9.0`.

:::

The following examples will assume you have an understanding of how [Jest mock classes work with JavaScript](Es6ClassMocks.md).

Expand Down
12 changes: 8 additions & 4 deletions website/versioned_docs/version-26.x/SnapshotTesting.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,15 @@ Once you're finished, Jest will give you a summary before returning back to watc

Inline snapshots behave identically to external snapshots (`.snap` files), except the snapshot values are written automatically back into the source code. This means you can get the benefits of automatically generated snapshots without having to switch to an external file to make sure the correct value was written.

> Inline snapshots are powered by [Prettier](https://prettier.io). To use inline snapshots you must have `prettier` installed in your project. Your Prettier configuration will be respected when writing to test files.
>
> If you have `prettier` installed in a location where Jest can't find it, you can tell Jest how to find it using the [`"prettierPath"`](./Configuration.md#prettierpath-string) configuration property.
:::info

Inline snapshots are powered by [Prettier](https://prettier.io). To use inline snapshots you must have `prettier` installed in your project. Your Prettier configuration will be respected when writing to test files.

If you have `prettier` installed in a location where Jest can't find it, you can tell Jest how to find it using the [`prettierPath`](./Configuration.md#prettierpath-string) configuration property.

:::

**Example:**
Example:

First, you write a test, calling `.toMatchInlineSnapshot()` with no arguments:

Expand Down
2 changes: 0 additions & 2 deletions website/versioned_docs/version-26.x/TimerMocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ describe('infiniteTimerGame', () => {

## Advance Timers by Time

##### renamed from `runTimersToTime` to `advanceTimersByTime` in Jest **22.0.0**

Another possibility is use `jest.advanceTimersByTime(msToRun)`. When this API is called, all timers are advanced by `msToRun` milliseconds. All pending "macro-tasks" that have been queued via setTimeout() or setInterval(), and would be executed during this time frame, will be executed. Additionally, if those macro-tasks schedule new macro-tasks that would be executed within the same time frame, those will be executed until there are no more macro-tasks remaining in the queue that should be run within msToRun milliseconds.

```javascript title="timerGame.js"
Expand Down
12 changes: 10 additions & 2 deletions website/versioned_docs/version-27.x/MockFunctionAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,11 @@ You can see an example of using Jest with TypeScript in our [GitHub repository](

### `jest.MockedFunction`

> `jest.MockedFunction` is available in the `@types/jest` module from version `24.9.0`.
:::tip

`jest.MockedFunction` is available in the `@types/jest` module from version `24.9.0`.

:::

The following examples will assume you have an understanding of how [Jest mock functions work with JavaScript](MockFunctions.md).

Expand Down Expand Up @@ -434,7 +438,11 @@ test('calculate calls add', () => {

### `jest.MockedClass`

> `jest.MockedClass` is available in the `@types/jest` module from version `24.9.0`.
:::tip

`jest.MockedClass` is available in the `@types/jest` module from version `24.9.0`.

:::

The following examples will assume you have an understanding of how [Jest mock classes work with JavaScript](Es6ClassMocks.md).

Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-27.x/SnapshotTesting.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Once you're finished, Jest will give you a summary before returning back to watc

Inline snapshots behave identically to external snapshots (`.snap` files), except the snapshot values are written automatically back into the source code. This means you can get the benefits of automatically generated snapshots without having to switch to an external file to make sure the correct value was written.

**Example:**
Example:

First, you write a test, calling `.toMatchInlineSnapshot()` with no arguments:

Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-28.x/SnapshotTesting.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Once you're finished, Jest will give you a summary before returning back to watc

Inline snapshots behave identically to external snapshots (`.snap` files), except the snapshot values are written automatically back into the source code. This means you can get the benefits of automatically generated snapshots without having to switch to an external file to make sure the correct value was written.

**Example:**
Example:

First, you write a test, calling `.toMatchInlineSnapshot()` with no arguments:

Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-29.0/SnapshotTesting.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Once you're finished, Jest will give you a summary before returning back to watc

Inline snapshots behave identically to external snapshots (`.snap` files), except the snapshot values are written automatically back into the source code. This means you can get the benefits of automatically generated snapshots without having to switch to an external file to make sure the correct value was written.

**Example:**
Example:

First, you write a test, calling `.toMatchInlineSnapshot()` with no arguments:

Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-29.1/SnapshotTesting.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Once you're finished, Jest will give you a summary before returning back to watc

Inline snapshots behave identically to external snapshots (`.snap` files), except the snapshot values are written automatically back into the source code. This means you can get the benefits of automatically generated snapshots without having to switch to an external file to make sure the correct value was written.

**Example:**
Example:

First, you write a test, calling `.toMatchInlineSnapshot()` with no arguments:

Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-29.2/SnapshotTesting.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Once you're finished, Jest will give you a summary before returning back to watc

Inline snapshots behave identically to external snapshots (`.snap` files), except the snapshot values are written automatically back into the source code. This means you can get the benefits of automatically generated snapshots without having to switch to an external file to make sure the correct value was written.

**Example:**
Example:

First, you write a test, calling `.toMatchInlineSnapshot()` with no arguments:

Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-29.3/SnapshotTesting.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Once you're finished, Jest will give you a summary before returning back to watc

Inline snapshots behave identically to external snapshots (`.snap` files), except the snapshot values are written automatically back into the source code. This means you can get the benefits of automatically generated snapshots without having to switch to an external file to make sure the correct value was written.

**Example:**
Example:

First, you write a test, calling `.toMatchInlineSnapshot()` with no arguments:

Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-29.4/SnapshotTesting.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Once you're finished, Jest will give you a summary before returning back to watc

Inline snapshots behave identically to external snapshots (`.snap` files), except the snapshot values are written automatically back into the source code. This means you can get the benefits of automatically generated snapshots without having to switch to an external file to make sure the correct value was written.

**Example:**
Example:

First, you write a test, calling `.toMatchInlineSnapshot()` with no arguments:

Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-29.5/SnapshotTesting.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Once you're finished, Jest will give you a summary before returning back to watc

Inline snapshots behave identically to external snapshots (`.snap` files), except the snapshot values are written automatically back into the source code. This means you can get the benefits of automatically generated snapshots without having to switch to an external file to make sure the correct value was written.

**Example:**
Example:

First, you write a test, calling `.toMatchInlineSnapshot()` with no arguments:

Expand Down

0 comments on commit d85d542

Please sign in to comment.