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

Minor docs updates for the migration guides #1116

Merged
merged 5 commits into from
Feb 21, 2024
Merged
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
48 changes: 24 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -444,22 +444,23 @@ The extension also features built-in conflict detection and quick fixes to assis
"clearOnRun": "terminal"
}
```

**Migration Guide**
<a id="outputconfig-migration"></a>

Migrating to the new `"jest.outputConfig"` can require some manual adjustments, especially if you're working in a multi-root workspace. Here are some guidelines to help with the transition:

1. **Workspace Level vs Workspace-Folder Level**: The new `"jest.outputConfig"` is a workspace-level setting, unlike legacy settings like `"jest.autoClearTerminal"` and `"jest.autoRevealOutput"`, which are workspace-folder level settings.

2. **Backward Compatibility**: If no `"jest.outputConfig"` is defined in your settings.json, the extension will attempt to generate a backward-compatible outputConfig in memory. This uses the `"testing.openTesting"` setting and any legacy settings (`"jest.autoClearTerminal"`, `"jest.autoRevealOutput"`) you might have. Note that this might only work for single-root workspaces.

3. **Migration Steps**:
- Use the `"Jest: Save Current Output Config"` command from the command palette to update your settings.json.
- (optional) Fix warning: The save does not include `"testing.openTesting"`, so you might see the conflict warning message. You can either use the "Quick Fix" action or adjust the `settings.json` manually (see [handling conflict](#outputconfig-conflict)).
- Finally, remove any deprecated settings.

By following these guidelines, you should be able to smoothly transition to using `"jest.outputConfig"`.
> [!NOTE]
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think we need the [!NOTE] here. Sorry if my earlier message didn't come across clearly.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is pretty minor, never mind. I can adjust it later if needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that's what I thought you meant at first. I was on the fence about whether the note makes it better or worse so I left it up to you.

The length of the README is getting unwieldy. If it sounds good to you, I might start sending PRs to break it up.

> <a id="outputconfig-migration"></a>
> **Migration Guide**
>
> Migrating to the new `"jest.outputConfig"` can require some manual adjustments, especially if you're working in a multi-root workspace. Here are some guidelines to help with the transition:
>
> 1. **Workspace Level vs Workspace-Folder Level**: The new `"jest.outputConfig"` is a workspace-level setting, unlike legacy settings like `"jest.autoClearTerminal"` and `"jest.autoRevealOutput"`, which are workspace-folder level settings.
>
> 2. **Backward Compatibility**: If no `"jest.outputConfig"` is defined in your settings.json, the extension will attempt to generate a backward-compatible outputConfig in memory. This uses the `"testing.openTesting"` setting and any legacy settings (`"jest.autoClearTerminal"`, `"jest.autoRevealOutput"`) you might have. Note that this might only work for single-root workspaces.
>
> 3. **Migration Steps**:
> - Use the `"Jest: Save Current Output Config"` command from the command palette to update your settings.json.
> - (optional) Fix warning: The save does not include `"testing.openTesting"`, so you might see the conflict warning message. You can either use the "Quick Fix" action or adjust the `settings.json` manually (see [handling conflict](#outputconfig-conflict)).
> - Finally, remove any deprecated settings.
>
> By following these guidelines, you should be able to smoothly transition to using `"jest.outputConfig"`.

---

Expand Down Expand Up @@ -563,9 +564,9 @@ Starting from v6.1.0, if no runMode is defined in settings.json, the extension w
---

#### autoRun
<div style="background-color: yellow; color: black; padding: 10px; border-radius: 5px;">
Note: As of v6.1.0, autoRun will be replaced by <a href="#runmode">runMode</a>. For transition details, please refer to the <a href="#runmode-migration">runMode migration</a>.
</div>

> [!WARNING]
> As of v6.1.0, autoRun will be replaced by <a href="#runmode">runMode</a>. For transition details, please refer to the <a href="#runmode-migration">runMode migration</a>.

AutoRun controls when tests should be executed automatically.

Expand Down Expand Up @@ -651,9 +652,8 @@ There are 2 ways to change autoRun:

#### testExplorer

<div style="background-color: yellow; color: black; padding: 10px; border-radius: 5px;">
As of v6.1.0, this setting has been folded into <a href="#runmode">runMode</a>. For transition details, please refer to the <a href="#runmode-migration">runMode migration</a>.
</div>
> [!WARNING]
> As of v6.1.0, this setting has been folded into <a href="#runmode">runMode</a>. For transition details, please refer to the <a href="#runmode-migration">runMode migration</a>.

```ts
testExplorer = {showInlineError?: boolean}
Expand Down Expand Up @@ -697,9 +697,9 @@ Default is `"jest.monitorLongRun":60000` (1 minute)
---

#### autoRevealOutput
<div style="background-color: yellow; color: black; padding: 10px; border-radius: 5px;">
As of v6.1.0, this setting has been folded into <a href="#runmode">runMode</a>. For transition details, please refer to the <a href="#runmode-migration">runMode migration</a>.
</div>

> [!WARNING]
> As of v6.1.0, this setting has been folded into <a href="#outputconfig">outputConfig</a>. For transition details, please refer to the <a href="#outputconfig-migration">outputConfig migration</a>.

```ts
autoRevealOutput = "on-run" | "on-exec-error" | "off"
Expand Down
Loading