Skip to content

Commit

Permalink
docs: watch admonitions (#13310)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulreece committed Sep 30, 2022
1 parent 2662f47 commit 6be272b
Show file tree
Hide file tree
Showing 7 changed files with 140 additions and 28 deletions.
24 changes: 20 additions & 4 deletions docs/WatchPlugins.md
Expand Up @@ -130,7 +130,11 @@ Watch Usage
› Press Enter to trigger a test run.
```

**Note**: If the key for your plugin already exists as a default key, your plugin will override that key.
:::note

If the key for your plugin already exists as a default key, your plugin will override that key.

:::

### `run(globalConfig, updateConfigAndRun)`

Expand All @@ -147,7 +151,11 @@ class MyWatchPlugin {
}
```

**Note**: If you do call `updateConfigAndRun`, your `run` method should not resolve to a truthy value, as that would trigger a double-run.
:::note

If you do call `updateConfigAndRun`, your `run` method should not resolve to a truthy value, as that would trigger a double-run.

:::

#### Authorized configuration keys

Expand Down Expand Up @@ -221,8 +229,16 @@ Any key not used by built-in functionality can be claimed, as you would expect.

Should your plugin attempt to overwrite a reserved key, Jest will error out with a descriptive message, something like:

> Watch plugin YourFaultyPlugin attempted to register key `q`, that is reserved internally for quitting watch mode. Please change the configuration key for this plugin.
```bash

Watch plugin YourFaultyPlugin attempted to register key `q`, that is reserved internally for quitting watch mode. Please change the configuration key for this plugin.

```

Third-party plugins are also forbidden to overwrite a key reserved already by another third-party plugin present earlier in the configured plugins list (`watchPlugins` array setting). When this happens, you’ll also get an error message that tries to help you fix that:

> Watch plugins YourFaultyPlugin and TheirFaultyPlugin both attempted to register key `x`. Please change the key configuration for one of the conflicting plugins to avoid overlap.
```bash

Watch plugins YourFaultyPlugin and TheirFaultyPlugin both attempted to register key `x`. Please change the key configuration for one of the conflicting plugins to avoid overlap.

```
24 changes: 20 additions & 4 deletions website/versioned_docs/version-25.x/WatchPlugins.md
Expand Up @@ -130,7 +130,11 @@ Watch Usage
› Press Enter to trigger a test run.
```

**Note**: If the key for your plugin already exists as a default key, your plugin will override that key.
:::note

If the key for your plugin already exists as a default key, your plugin will override that key.

:::

### `run(globalConfig, updateConfigAndRun)`

Expand All @@ -147,7 +151,11 @@ class MyWatchPlugin {
}
```

**Note**: If you do call `updateConfigAndRun`, your `run` method should not resolve to a truthy value, as that would trigger a double-run.
:::note

If you do call `updateConfigAndRun`, your `run` method should not resolve to a truthy value, as that would trigger a double-run.

:::

#### Authorized configuration keys

Expand Down Expand Up @@ -221,8 +229,16 @@ Any key not used by built-in functionality can be claimed, as you would expect.

Should your plugin attempt to overwrite a reserved key, Jest will error out with a descriptive message, something like:

> Watch plugin YourFaultyPlugin attempted to register key `q`, that is reserved internally for quitting watch mode. Please change the configuration key for this plugin.
```bash

Watch plugin YourFaultyPlugin attempted to register key `q`, that is reserved internally for quitting watch mode. Please change the configuration key for this plugin.

```

Third-party plugins are also forbidden to overwrite a key reserved already by another third-party plugin present earlier in the configured plugins list (`watchPlugins` array setting). When this happens, you’ll also get an error message that tries to help you fix that:

> Watch plugins YourFaultyPlugin and TheirFaultyPlugin both attempted to register key `x`. Please change the key configuration for one of the conflicting plugins to avoid overlap.
```bash

Watch plugins YourFaultyPlugin and TheirFaultyPlugin both attempted to register key `x`. Please change the key configuration for one of the conflicting plugins to avoid overlap.

```
24 changes: 20 additions & 4 deletions website/versioned_docs/version-26.x/WatchPlugins.md
Expand Up @@ -130,7 +130,11 @@ Watch Usage
› Press Enter to trigger a test run.
```

**Note**: If the key for your plugin already exists as a default key, your plugin will override that key.
:::note

If the key for your plugin already exists as a default key, your plugin will override that key.

:::

### `run(globalConfig, updateConfigAndRun)`

Expand All @@ -147,7 +151,11 @@ class MyWatchPlugin {
}
```

**Note**: If you do call `updateConfigAndRun`, your `run` method should not resolve to a truthy value, as that would trigger a double-run.
:::note

If you do call `updateConfigAndRun`, your `run` method should not resolve to a truthy value, as that would trigger a double-run.

:::

#### Authorized configuration keys

Expand Down Expand Up @@ -221,8 +229,16 @@ Any key not used by built-in functionality can be claimed, as you would expect.

Should your plugin attempt to overwrite a reserved key, Jest will error out with a descriptive message, something like:

> Watch plugin YourFaultyPlugin attempted to register key `q`, that is reserved internally for quitting watch mode. Please change the configuration key for this plugin.
```bash

Watch plugin YourFaultyPlugin attempted to register key `q`, that is reserved internally for quitting watch mode. Please change the configuration key for this plugin.

```

Third-party plugins are also forbidden to overwrite a key reserved already by another third-party plugin present earlier in the configured plugins list (`watchPlugins` array setting). When this happens, you’ll also get an error message that tries to help you fix that:

> Watch plugins YourFaultyPlugin and TheirFaultyPlugin both attempted to register key `x`. Please change the key configuration for one of the conflicting plugins to avoid overlap.
```bash

Watch plugins YourFaultyPlugin and TheirFaultyPlugin both attempted to register key `x`. Please change the key configuration for one of the conflicting plugins to avoid overlap.

```
24 changes: 20 additions & 4 deletions website/versioned_docs/version-27.x/WatchPlugins.md
Expand Up @@ -130,7 +130,11 @@ Watch Usage
› Press Enter to trigger a test run.
```

**Note**: If the key for your plugin already exists as a default key, your plugin will override that key.
:::note

If the key for your plugin already exists as a default key, your plugin will override that key.

:::

### `run(globalConfig, updateConfigAndRun)`

Expand All @@ -147,7 +151,11 @@ class MyWatchPlugin {
}
```

**Note**: If you do call `updateConfigAndRun`, your `run` method should not resolve to a truthy value, as that would trigger a double-run.
:::note

If you do call `updateConfigAndRun`, your `run` method should not resolve to a truthy value, as that would trigger a double-run.

:::

#### Authorized configuration keys

Expand Down Expand Up @@ -221,8 +229,16 @@ Any key not used by built-in functionality can be claimed, as you would expect.

Should your plugin attempt to overwrite a reserved key, Jest will error out with a descriptive message, something like:

> Watch plugin YourFaultyPlugin attempted to register key `q`, that is reserved internally for quitting watch mode. Please change the configuration key for this plugin.
```bash

Watch plugin YourFaultyPlugin attempted to register key `q`, that is reserved internally for quitting watch mode. Please change the configuration key for this plugin.

```

Third-party plugins are also forbidden to overwrite a key reserved already by another third-party plugin present earlier in the configured plugins list (`watchPlugins` array setting). When this happens, you’ll also get an error message that tries to help you fix that:

> Watch plugins YourFaultyPlugin and TheirFaultyPlugin both attempted to register key `x`. Please change the key configuration for one of the conflicting plugins to avoid overlap.
```bash

Watch plugins YourFaultyPlugin and TheirFaultyPlugin both attempted to register key `x`. Please change the key configuration for one of the conflicting plugins to avoid overlap.

```
24 changes: 20 additions & 4 deletions website/versioned_docs/version-28.x/WatchPlugins.md
Expand Up @@ -130,7 +130,11 @@ Watch Usage
› Press Enter to trigger a test run.
```

**Note**: If the key for your plugin already exists as a default key, your plugin will override that key.
:::note

If the key for your plugin already exists as a default key, your plugin will override that key.

:::

### `run(globalConfig, updateConfigAndRun)`

Expand All @@ -147,7 +151,11 @@ class MyWatchPlugin {
}
```

**Note**: If you do call `updateConfigAndRun`, your `run` method should not resolve to a truthy value, as that would trigger a double-run.
:::note

If you do call `updateConfigAndRun`, your `run` method should not resolve to a truthy value, as that would trigger a double-run.

:::

#### Authorized configuration keys

Expand Down Expand Up @@ -221,8 +229,16 @@ Any key not used by built-in functionality can be claimed, as you would expect.

Should your plugin attempt to overwrite a reserved key, Jest will error out with a descriptive message, something like:

> Watch plugin YourFaultyPlugin attempted to register key `q`, that is reserved internally for quitting watch mode. Please change the configuration key for this plugin.
```bash

Watch plugin YourFaultyPlugin attempted to register key `q`, that is reserved internally for quitting watch mode. Please change the configuration key for this plugin.

```

Third-party plugins are also forbidden to overwrite a key reserved already by another third-party plugin present earlier in the configured plugins list (`watchPlugins` array setting). When this happens, you’ll also get an error message that tries to help you fix that:

> Watch plugins YourFaultyPlugin and TheirFaultyPlugin both attempted to register key `x`. Please change the key configuration for one of the conflicting plugins to avoid overlap.
```bash

Watch plugins YourFaultyPlugin and TheirFaultyPlugin both attempted to register key `x`. Please change the key configuration for one of the conflicting plugins to avoid overlap.

```
24 changes: 20 additions & 4 deletions website/versioned_docs/version-29.0/WatchPlugins.md
Expand Up @@ -130,7 +130,11 @@ Watch Usage
› Press Enter to trigger a test run.
```

**Note**: If the key for your plugin already exists as a default key, your plugin will override that key.
:::note

If the key for your plugin already exists as a default key, your plugin will override that key.

:::

### `run(globalConfig, updateConfigAndRun)`

Expand All @@ -147,7 +151,11 @@ class MyWatchPlugin {
}
```

**Note**: If you do call `updateConfigAndRun`, your `run` method should not resolve to a truthy value, as that would trigger a double-run.
:::note

If you do call `updateConfigAndRun`, your `run` method should not resolve to a truthy value, as that would trigger a double-run.

:::

#### Authorized configuration keys

Expand Down Expand Up @@ -221,8 +229,16 @@ Any key not used by built-in functionality can be claimed, as you would expect.

Should your plugin attempt to overwrite a reserved key, Jest will error out with a descriptive message, something like:

> Watch plugin YourFaultyPlugin attempted to register key `q`, that is reserved internally for quitting watch mode. Please change the configuration key for this plugin.
```bash

Watch plugin YourFaultyPlugin attempted to register key `q`, that is reserved internally for quitting watch mode. Please change the configuration key for this plugin.

```

Third-party plugins are also forbidden to overwrite a key reserved already by another third-party plugin present earlier in the configured plugins list (`watchPlugins` array setting). When this happens, you’ll also get an error message that tries to help you fix that:

> Watch plugins YourFaultyPlugin and TheirFaultyPlugin both attempted to register key `x`. Please change the key configuration for one of the conflicting plugins to avoid overlap.
```bash

Watch plugins YourFaultyPlugin and TheirFaultyPlugin both attempted to register key `x`. Please change the key configuration for one of the conflicting plugins to avoid overlap.

```
24 changes: 20 additions & 4 deletions website/versioned_docs/version-29.1/WatchPlugins.md
Expand Up @@ -130,7 +130,11 @@ Watch Usage
› Press Enter to trigger a test run.
```

**Note**: If the key for your plugin already exists as a default key, your plugin will override that key.
:::note

If the key for your plugin already exists as a default key, your plugin will override that key.

:::

### `run(globalConfig, updateConfigAndRun)`

Expand All @@ -147,7 +151,11 @@ class MyWatchPlugin {
}
```

**Note**: If you do call `updateConfigAndRun`, your `run` method should not resolve to a truthy value, as that would trigger a double-run.
:::note

If you do call `updateConfigAndRun`, your `run` method should not resolve to a truthy value, as that would trigger a double-run.

:::

#### Authorized configuration keys

Expand Down Expand Up @@ -221,8 +229,16 @@ Any key not used by built-in functionality can be claimed, as you would expect.

Should your plugin attempt to overwrite a reserved key, Jest will error out with a descriptive message, something like:

> Watch plugin YourFaultyPlugin attempted to register key `q`, that is reserved internally for quitting watch mode. Please change the configuration key for this plugin.
```bash

Watch plugin YourFaultyPlugin attempted to register key `q`, that is reserved internally for quitting watch mode. Please change the configuration key for this plugin.

```

Third-party plugins are also forbidden to overwrite a key reserved already by another third-party plugin present earlier in the configured plugins list (`watchPlugins` array setting). When this happens, you’ll also get an error message that tries to help you fix that:

> Watch plugins YourFaultyPlugin and TheirFaultyPlugin both attempted to register key `x`. Please change the key configuration for one of the conflicting plugins to avoid overlap.
```bash

Watch plugins YourFaultyPlugin and TheirFaultyPlugin both attempted to register key `x`. Please change the key configuration for one of the conflicting plugins to avoid overlap.

```

0 comments on commit 6be272b

Please sign in to comment.