Skip to content

Latest commit

 

History

History
512 lines (357 loc) · 29.1 KB

release-note-v6.md

File metadata and controls

512 lines (357 loc) · 29.1 KB

vscode-jest v6.x Releases

Release Notes


v6.4.0

This is a cumulative release that incorporates updates and fixes introduced in the v6.3.0 and v6.3.1 pre-releases. This release brings enhanced debugging capabilities, new features for Jest v30 compatibility, and improved coverage integration with VS Code, along with several bug fixes and dependency updates.

Features

  • Enhanced Debugging for All Test Items

    • Expanded debugging support across all test items, allowing users to initiate debugging from any test root, directory, or individual test item. This improvement brings flexibility in debugging workflows directly from the Test Explorer. (#1181 - @connectdotz)
  • Support for Jest v30 Syntax

    • The extension now includes built-in support for Jest v30 (v30.0.0-alpha.6 and above). It automatically detects and adapts to the new TestPathPatterns syntax, configurable via a new jest.useJest30 setting. (#1153 - @connectdotz)
  • VS Code Test Coverage API and UI Integration

    • Introduced integration with VS Code’s native Test Coverage API, enabling interactive coverage tracking and display within the editor and the Test Explorer Coverage panel. This new approach improves accessibility and interactivity for test coverage. The original coverage feature remains available for backward compatibility. (#1151 - @connectdotz)

Bug Fixes

  • Resolved Documentation Link Issue for v6.3.0-next

    • Corrected broken documentation links that affected navigation and guidance for v6.3.0-next users. (#1169 - @connectdotz)
  • Fixed Coverage Range Calculation Issue

    • Addressed an issue where coverage ranges could display as empty, ensuring consistent and accurate coverage reporting across files. (#1177 - @connectdotz)
  • Improved Windows testNamePattern Resolution

    • Resolved an issue where the testNamePattern setting was not recognized on Windows, enabling consistent behavior across platforms. (#1179 - @connectdotz)
  • Improved Test Status Reporting on Suite Failures

    • Fixed a bug where test statuses sometimes failed to update correctly when the test suite could not run due to issues like compile errors. (#1165 - @connectdotz)
  • Incorporated jest.nodeEnv into Debug Configurations

    • Ensured that jest.nodeEnv is included in auto-generated debug configurations for better environment compatibility. (#1167 - @connectdotz)
  • Documentation Fixes

    • Corrected setup-wizard documentation links to ensure a smoother onboarding experience. (#1154 - @pierluigigiancola)

Dependency Updates

  • Webpack: Bumped from 5.91.0 to 5.94.0, improving build performance and compatibility. (#1173 - @dependabot)
  • Micromatch: Updated from 4.0.7 to 4.0.8 to address minor matching issues. (#1176 - @dependabot)

CHANGELOG


v6.3 (pre-release)

v6.3.1 (pre-release)

Features

  • Make all test items debuggable by @connectdotz in #1181.
    Prior to v6.3.1, only test files and test blocks were debuggable. Now, users can debug from any test item, including the test roots and directories.

Bug Fixes

  • Fix documentation link for v6.3.0-next by @connectdotz in #1169.
  • Fix empty coverage range issue by @connectdotz in #1177.
  • Fix Windows testNamePattern not found issue by @connectdotz in #1179.

Dependency Updates

  • Bump webpack from 5.91.0 to 5.94.0 by @dependabot in #1173.
  • Bump micromatch from 4.0.7 to 4.0.8 by @dependabot in #1176.

CHANGELOG

v6.3.0 (pre-release)

Features

  • Support for Jest v30 (v30.0.0-alpha.6 and up).

    • The extension now automatically detects Jest v30 and switches to the new syntax, specifically TestPathPatterns. This behavior can be controlled via a new setting, jest.useJest30, which, when enabled, instructs the extension to immediately use the Jest v30 syntax. (#1153 - @connectdotz)
  • Integration with VS Code's Test Coverage API and UI.

    • The extension now provides test coverage via the native VS Code API, enabling interactive coverage runs and displaying results in both the editor and the Test Explorer Coverage panel. (#1151 - @connectdotz)

      test-coverage-explorer

    • Note: The original coverage feature in the extension will remain functional for now. However, we plan to deprecate it in the near future. If you have any concerns on this change, please open an issue to let us know.

Bug Fixes

  • Correctly incorporate jest.nodeEnv into the auto-generated debug configuration. (#1167 - @connectdotz)

  • Resolved an issue where tests sometimes failed to reflect the correct status when the test suite couldn't run (e.g., due to compile errors). (#1165 - @connectdotz)

  • Fixed broken links in the setup-wizard documentation. (#1154 - @pierluigigiancola)

CHANGELOG


v6.2

v6.2.5

Bug Fixes

  • Fixed an issue (#1145) where an autoRun (watch, on-save) might not update the test status in Editor and TestExplorer in subsequent runs. (#1146 - @connectdotz)

CHANGELOG


v6.2.4

Enhancements

  • Improved handling of zombie Jest processes during on-demand runs for scenarios like stencil and rt-test, which previously failed to correctly interpret "watchAll=false". We encourage users to report issues to the underlying systems. In the meantime, this extension will automatically terminate such zombie processes during on-demand runs, preventing them from blocking the execution queue. (#1134 - @connectdotz)

Bug Fixes

  • Fixed an issue where the Test Explorer's Stop button did not terminate the underlying Jest process, potentially blocking the execution queue for subsequent on-demand runs. (#1134 - @connectdotz)
  • Resolved a problem where the "Jest: Run All Tests" command was obstructed by the watch mode's ongoing execution. (#1132 - @connectdotz)

CHANGELOG


v6.2.3

This release is a patch release with the following changes:

Enhancement

  • Improve output-focus default behavior for auto runs (e.g., "watch", "on-save"). This will eliminate the issue that the focus auto switching to "TEST RESULTS" panel whenever files are saved in auto-run modes. Now the default behavior is runMode aware and will not auto switch for auto runs unless specifically configured to do so. See default output focus behavior. (#1128 - @connectdotz)
  • docs: update README to fix jest run mode type. (#1126 - @kota-kamikawa)

CHANGELOG


v6.2.2

This release is a patch release with the following changes:

Enhancement

  • Improved output config validation logic and showed warning if detected upon starting up. (#1119 - @connectdotz)

  • Added more diagnosis and fix-it instructions in the jest terminal: (#1119 - @connectdotz)

    • Display critical settings such as "jest.runMode", "jest.outputConfig" and "testing.openTesting" settings
    • Provide warning messages for common output issues, such as aggressive auto-focus for auto run modes, when detected. Provides quick fix instructions to address them.

Bug Fixes

  • Fixed an outputConfig initialization bug that did not honor "testing.openTesting": "openOnTestFailure" setting correctly. (#1119 - @connectdotz)
  • Fixed missing test error auto focusing for watch mode run. (#1120 - @connectdotz)

New Command

  • Added a new command "Jest: Disable Auto Focus Test Output" to easily disable TEST RESULTS panel auto focus. It will set the output to the "neutral" mode, i.e., no auto focusing. (#1119 - @connectdotz)

Documentation

  • Minor docs updates for the migration guides. (#1116 - @pmcelhaney)
  • Minor update for the output config info in README and release notes. (#1119 - @connectdotz)

CHANGELOG


v6.2.1

This release is a patch release with the following bug fix:

  • Fixed test run errors due to incorrect sub folder paths from the test Explorer panel. (#1114 - @connectdotz)

CHANGELOG


v6.2.0

This version is a rollup of pre-releases v6.0 through v6.1, which implemented a few long requested features, such as better monorepo project support, more intuitive ways to defer and resume testing, and showing accurate test results in TEST RESULT panel.

v6.2.0-intro

New Features Summary

  • Virtual Folders: New in v6.0.0, jest.virtualFolders now supports monorepos for single-root workspaces and multiple Jest configurations in the same folder — long-awaited capabilities for developers dealing with complex project setups. Details
  • Integration with VSCode "TEST RESULTS" Panel: Introduced in v6.1.0, the jest.outputConfig setting enables the display of test results directly in the VSCode "TEST RESULTS" panel and consolidates various output settings. Details (:warning: Breaking Change)
  • Replace "autoRun" with "runMode": Debuting in v6.1.0, jest.runMode replaces and expands upon jest.autoRun with options like 'deferred' mode, ideal for large projects seeking just-in-time test execution. It also consolidates related settings for a cleaner configuration experience. Details (:warning: Breaking Change)
  • Support for Spawning Jest with Dashed Arguments: Available from v6.0.0, the new jest.useDashedArgs setting allows the extension to spawn Jest processes with dashed arguments, required by some frameworks such as Angular. Details
  • Control Extension Activation within Each Folder: Introduced in v6.0.0, the jest.enable setting allows granular control over the Jest extension's activation on a per-folder basis in VS Code workspaces. This enhancement is beneficial for developers working in multi-root workspaces or projects with mixed languages. Details

Bug Fixes and Technical Debt Reduction

  • Please refer to the pre-release notes for a comprehensive list.

Breaking Changes

  • The following settings have been consolidated into runMode and outputConfig and will be removed in the future release:

    • "jest.autoRun"
    • "jest.showCoverageOnLoad"
    • "jest.TestExplorer"
    • "jest.autoRevealOutput"
    • "jest.autoClearTerminal"
  • While we strive for seamless auto migration and backward compatibility, it might not cover all configurations. Should you discover any discrepancies or unexpected behavior, further guidance and support can be found in the detailed release notes linked above and the migrationn guides below:

CHANGELOG


v6.1 (pre-release)

This release introduces a more streamlined "jest.runMode" setting to boost test execution efficiency, coupled with the integration of the "TEST RESULTS" panel via the new "jest.outputConfig" for a consistent test results display. These enhancements should simplify the transition for newcomers and also improve startup times for larger projects, while offering more control over test output visibility.

While we aim for backward compatibility, the nature of the advancements may not align seamlessly with all existing configurations. Users are advised to refer to the Migration Guide provided for each feature to ensure a smooth transition.

As with any pre-release, your feedback is invaluable to us. If you encounter any unexpected behavior or have suggestions for improvement, do not hesitate to report it here.

Main Features

1. Enhanced Test Execution Control with "runMode"

runModeSwitch.mov

Replacing jest.autoRun and related settings, the new runMode configuration simplifies the test execution process, resolves confusion for newcomers, and introduces more efficient workflows with modes like "deferred."

1.1 The "deferred" mode

The "deferred" mode addresses startup performance, particularly for large projects, by postponing preparation tasks until the first test run or until the user disables deferred mode.

1.2 Configuration and Examples

"jest.runMode" offers flexible configurations, allowing for both predefined modes and detailed customization. Here are some configuration examples:

// for "on-demand" runMode
{
  "jest.runMode": "on-demand"
}

// for "on-demand" and deferred: the most light-weight startup 
{
  "jest.runMode": {
    "type": "on-demand",
    "deferred": true 
  }
}

// watch mode with coverage and startup full run: the most complete setup
{
  "jest.runMode": {
    "type": "watch",
    "runAllTestsOnStartup": true,
    "coverage": true
  }
}

// on-save mode for test file only and show inline error
{
  "jest.runMode": {
    "type": "on-save",
    "testFileOnly": true,
    "showInlineError": true
  }
}

Detailed explanations and more examples are available in the RunMode.

1.3 Deprecations and Migrations

The following settings have been consolidated into runMode and will be removed in the future release:

  • "jest.autoRun"
  • "jest.showCoverageOnLoad"
  • "jest.TestExplorer"

For a smooth transition, users should migrate to the new runMode`` setting. Assistance with migration is provided by the "Jest: Save Current RunMode"`` command in the command palette. Complete migration steps can be found in the RunMode Migration Guide.

2. Support VSCode "TEST RESULTS" Panel with "jest.outputConfig"

test-results-run-test.mov

The extension now supports the display of test results in VSCode's "TEST RESULTS" panel, complementing the traditional output in the integrated TERMINAL, through a new "jest.outputConfig" setting. This allows for a simple and consistent control over both panels.

2.1 "TEST RESULTS" Panel Integration

The VSCode "TEST RESULTS" panel is controlled by a native "testing.openTesting" setting, which might not align with the extension's settings. To avoid conflicts, you may set "testing.openTesting" to "neverOpen" if you prefer this extension to handle the panel behavior through the new "jest.outputConfig" setting. More detailed explanation can be found in the Handling Conflict section.

2.2 Configuration and Examples

We've introduced the "jest.outputConfig" setting to give users comprehensive control over the test output behavior across TERMINAL and TEST RESULTS panels, moving to a workspace-level setting for broader applicability.

Here are a few scenarios and how to configure them:

// Minimal interaction, suitable for watch/on-save modes
{
  "testing.openTesting": "neverOpen",
  "jest.outputConfig": "neutral"
}

// or semi-minimal interaction, suitable for watch/on-save modes prefer to see output if there is errors
{
  "testing.openTesting": "neverOpen",
  "jest.outputConfig": {
    "revealOn": "error",
    "revealWithFocus": "test-results"
  }
}

// Auto-focus on "TEST RESULTS" when run starts, ideal for on-demand testing
{
  "testing.openTesting": "neverOpen",
  "jest.outputConfig": {
    "revealOn": "run",
    "revealWithFocus": "test-results"
  }
}

// or Auto-focus on "TEST RESULTS" when errors occurred, for on-demand testing prefer to only show output with errors 
{
  "testing.openTesting": "neverOpen",
  "jest.outputConfig": {
    "revealOn": "error",
    "revealWithFocus": "test-results"
  }
}

// Terminal-focused output with clean start for each run, preferred for on-demand mode
{
  "testing.openTesting": "neverOpen",
  "jest.outputConfig": {
    "revealWithFocus": "terminal",
    "clearOnRun": "terminal"
  }
}

For more detailed examples and explanations, refer to the OutputConfig.

2.3 Deprecations and Migration

The following settings have been consolidated into outputConfig and will be removed in the future release:

  • "jest.autoRevealOutput"
  • "jest.autoClearTerminal"

To migrate, use the "Jest: Save Current Output Config" command, and then manually adjust your "settings.json" as needed. If any conflicts arise, the extension will guide you through resolving them.

For a step-by-step migration process, see the OutputConfig Migration Guide.

Bug Fixes

  • Fixed an issue where the virtual folder rootPath was not resolved correctly for folder test items, causing test runs or debugging to fail. (#1080 - @akwodkiewicz)
  • Resolved a matching problem during manual test runs where a non-exact match led to more tests being run than specified. (#1091 - @connectdotz)
  • Corrected the status recording for running ".each" test/describe blocks which sometimes did not reflect accurately. (#1092 - @connectdotz)
  • fix anchors in contributing.md file by @krivonos28 in #1102
  • more fault-tolerant for shell setting by @connectdotz in #1100
  • fix active editor files sometimes got attached to the wrong workspace folder by @connectdotz in #1108

Technical Debt

  • Updated the CI node version check to now include versions 18 through 20, ensuring compatibility with the latest node releases. (#1088 - @connectdotz)
  • Upgraded tooling dependencies to their latest versions to improve development workflows and bring in new features and bug fixes from those tools. (#1089 - @connectdotz)

v6.0 (pre-release)

This major release introduces the 'Virtual Folders' feature. Much like a VSCode workspace folder, a 'Virtual Folder' allows you to manage a custom Jest runtime environment, each configurable with its own resource-level settings. This is particularly useful for projects with multiple Jest configurations or monorepo structures. While we've ensured backward compatibility, the introduction of 'Virtual Folders' involved significant internal changes that prompted a major version bump.

Main Features

1. Virtual Folders

Supporting multiple jest configs is a common use cases for monorepo projects and projects with multiple test environments, such as unit and integration tests. We introduced monorepo support with vscode multi-root workspaces a few years ago. While it works well for most use cases, it fell short for multi-test-environment that share the same code base (folder). This version will close this gap with the Virtual Folders.

For example, the unit vs. integration tests can now be set up as the following:

// <project>/.vscode/settings.json
{
     "jest.virtualFolders": [
       {
        "name": "unit-tests", 
        "jestCommandLine": "yarn test --config=jest.unit.config.js", 
        "autoRun": "watch"
      },
      {
        "name": "integration-tests", 
        "jestCommandLine": "yarn test --config=jest.integration.config.js", 
        "autoRun": "off"
      }
     ]
   }

And yes you can indeed use virtual folders with monorepo projects. For example, the following configuration will run tests for each package in a monorepo project:

// <project>/.vscode/settings.json 
{
 "jest.virtualFolders": [
   {"name": "package1", "rootPath": "packages/package1"},
   {"name": "package2", "rootPath": "packages/package2"}
 ]
}

So when to use multi-root workspaces vs. virtual folders? In short, if you created a multi-root workspace simply for running different jest config - you could probably just use "jest.virtualFolders" instead. If you do require different non-jest vscode settings for each folder, continue to use multi-root workspace. More details in Virtual Folders.

2. Support spawning jest with dashed arguments

In light of Angular's decision to drop support for CamelCase arguments, we've been hearing a lot of you asking for a switch to dashed-arguments when running Jest commands. Therefore, a new optional setting "jest.useDashedArgs" is introduced.

However, bear in mind that you might encounter compatibility issue with other tools/systems. For instance, we've identified an issue in react-script where "watch-all"=false (an argument the extension appended) isn't recognized (see facebook/react-script#12801 for more details). Please report them if you encounter any.

See useDashedArgs for more details.

3. Control extension activation within each folder

A new setting"jest.enable" is added as a quick way to turn off the extension feature for the given folder/virtual-folder without uninstall/disable completely in vscode.

This is indeed similar to "jest.disabledWorkspaceFolders", which is a "window" level setting (on the root of the workspace). Given the target is the folder itself, we believe it makes more sense to put the control "jest.enable" in folder level instead. It could also provide better extensibility down the road, such as "deferred-activation". We hope "jest.enable" will eventually replace "jest.disabledWorkspaceFolders".

See Customization for more details.

4. Auto clear output upon test run

Introduced a new setting - "jest.autoClearOutput" - to clear the output terminal before each test run. Default is false for backward compatibility. This is useful when you want to see only the last run output.

See Customization for more details.

Fixes

  • Fixed v2 debug config variable substitution for multi-variable in a given argument. (#1040 - @adrianisk)
  • Fixed a source code parsing error for nonLiteralName. (#1024 - @connectdotz)
  • Various documentation fixes
  • Address security vulnerability with dependencies. (#1011)

CHANGELOG