Skip to content

Add filterNode option to prettyDOM for filtering browser assertion error output#9475

Merged
sheremet-va merged 9 commits intomainfrom
copilot/add-error-output-filtering
Jan 19, 2026
Merged

Add filterNode option to prettyDOM for filtering browser assertion error output#9475
sheremet-va merged 9 commits intomainfrom
copilot/add-error-output-filtering

Conversation

Copy link
Contributor

Copilot AI commented Jan 16, 2026

Implementation Complete: Browser Mode Assertion Error Output Filtering

  • Study the current prettyDOM implementation in packages/browser/src/client/tester/context.ts
  • Add a filterNode option to StringifyOptions type in packages/utils/src/display.ts
  • Create a custom DOMElement plugin that filters nodes based on CSS selector
  • Update configurePrettyDOM to accept the filterNode option
  • Update the TypeScript type definitions to expose the new option
  • Write tests to verify the filtering functionality
  • Build and typecheck pass successfully
  • Linting complete
  • Add documentation to context.md
  • Address all PR feedback
  • Simplify API to accept string directly
  • Add inline snapshots to all tests
  • Fix documentation formatting
  • Handle whitespace-only text nodes
  • Remove trailing spaces

Summary

This PR adds the ability to filter out irrelevant markup from browser mode assertion error outputs, similar to Testing Library's defaultIgnore configuration.

Changes Made:

  1. Created DOMElementFilter plugin (packages/pretty-format/src/plugins/DOMElementFilter.ts):

    • Custom pretty-format plugin that filters DOM nodes during serialization
    • Accepts a filterNode callback to determine which nodes to include
    • Automatically filters out whitespace-only text nodes to prevent empty lines in output
  2. Extended StringifyOptions (packages/utils/src/display.ts):

    • Added filterNode?: string | ((node: any) => boolean) option
    • String values are treated as CSS selectors for filtering elements
    • Function values provide custom filtering logic for advanced use cases
    • Added internal createNodeFilterFromSelector function to convert CSS selectors to filter functions
  3. Updated type definitions (packages/browser/context.d.ts):

    • Updated to reflect simplified API that accepts strings directly
  4. Added comprehensive tests (test/browser/test/utils.test.ts):

    • Test filtering with CSS selector strings
    • Test default configuration via configurePrettyDOM
    • Test wildcard selectors for nested content
    • All tests include inline snapshots showing expected filtered output
    • Reset logic moved to beforeEach hook for better error handling
  5. Added documentation (docs/api/browser/context.md):

    • Comprehensive guide on configurePrettyDOM options
    • Direct CSS selector usage examples
    • Common filtering patterns (scripts, styles, data attributes, wildcards)
    • Version annotations inline with headings
    • Custom anchors for deep linking

Usage Example:

import { utils } from 'vitest/browser'

// Simple: use CSS selector string directly
utils.configurePrettyDOM({
  filterNode: 'script, style, [data-test-hide]'
})

// Or use directly with prettyDOM
const html = utils.prettyDOM(element, undefined, {
  filterNode: 'script, style'
})

// Advanced: custom filter function
utils.configurePrettyDOM({
  filterNode: (node) => node.nodeType !== 8 // filter comments
})
Original prompt

This section details on the original issue you should resolve

<issue_title>Add assertion error output filtering option(s) for browser mode</issue_title>
<issue_description>### Clear and concise description of the problem

Sometimes the output from failed browser mode assertions can contain a lot of irrelevant markup. For example, if I have an irrelevant SVG at the top of my output I see its full content printed for every test failure:

Caused by: VitestBrowserElementError: Cannot find element with locator: getByRole('form', { name: 'Deposit' }).getByText(/has been added to your balance/i)

<body>






  <div>
    <svg
      data-test-hide="true"
      id="uqn-t"
      viewBox="0 0 20 20"
    >
      <style … />
      <defs … />
      <rect … />
      <rect … />
      <rect … />
      <rect … />
      <g … />
    </svg>
    <div>
      <nav … />
      <section … />
      <nav … />
      <h3 … />
      <form … />
      <h3 … />
      <form … />
      <div … />
    </div>
  </div>
</body>...

This irrelevant content makes it harder to find the markup that might actually help me identify the cause of the test failure.

Suggested solution

Testing Library has a configuration setting called defaultIgnore that, in their words:

...determines the nodes that are being ignored when errors are printed.

I'd love to have a similar option in Vitest browser mode.

When using Testing Library, we typically set this to something like script, style, [data-test-hide], [data-test-hide-content] *. This allows us to easily exclude an entire element from test failure output (or just its content) by using a simple data attribute.

Alternative

No response

Additional context

Follows on from discussion at #7459.

Validations

<agent_instructions>Vitest provides utils from vitest/browser entry point. It exposes configurePrettyDOM method. Add an option there to hide nodes. The source of the file is in packages/browser/src/client/tester/context.ts

It might be possible that you will have to write a new prettyDOM plugin for this. You can read testing-library source code to see how it's implemented there</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@netlify
Copy link

netlify bot commented Jan 16, 2026

Deploy Preview for vitest-dev ready!

Name Link
🔨 Latest commit 8e179ee
🔍 Latest deploy log https://app.netlify.com/projects/vitest-dev/deploys/696a6b2dd6ab9b00081e678f
😎 Deploy Preview https://deploy-preview-9475--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

- Created DOMElementFilter plugin to support node filtering during pretty printing
- Added filterNode option to StringifyOptions interface
- Added createNodeFilter helper function to easily create CSS selector-based filters
- Updated configurePrettyDOM to accept filterNode option
- Added tests for the filtering functionality
- Exported createDOMElementFilter from pretty-format package

Co-authored-by: sheremet-va <16173870+sheremet-va@users.noreply.github.com>
Copilot AI changed the title [WIP] Add assertion error output filtering option for browser mode Add filterNode option to prettyDOM for filtering browser assertion error output Jan 16, 2026
Copilot AI requested a review from sheremet-va January 16, 2026 16:05
Copy link
Member

@sheremet-va sheremet-va left a comment

Choose a reason for hiding this comment

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

Please, can you also add a section explaining new options in docs/api/browser/context.md

expect(result).not.toContain('console.log')
expect(result).not.toContain('color: red')
expect(result).not.toContain('hidden content')
expect(result).toContain('visible content')
Copy link
Member

Choose a reason for hiding this comment

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

Can you add assertion with toMatchInlineSnapshot to see the whole string?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added toMatchInlineSnapshot() to the test in commit 37380ac.

*
* // Filter out script, style, and elements with data-test-hide attribute
* utils.configurePrettyDOM({
* filterNode: utils.createNodeFilter('script, style, [data-test-hide]')
Copy link
Member

Choose a reason for hiding this comment

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

Can we just make it accept a string for simplicity?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The function already accepts a string selector. The return type is a filter function because configurePrettyDOM expects filterNode to be a function (node: any) => boolean. This design matches Testing Library's approach and provides flexibility for users who want to implement custom filtering logic beyond CSS selectors.

…add documentation

- Added toMatchInlineSnapshot to filterNode test for better visibility
- Marked createNodeFilter as @experimental in JSDoc
- Added comprehensive documentation section in docs/api/browser/context.md explaining:
  - configurePrettyDOM options
  - createNodeFilter usage with examples
  - Common filtering patterns

Co-authored-by: sheremet-va <16173870+sheremet-va@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 16, 2026

Please, can you also add a section explaining new options in docs/api/browser/context.md

Added comprehensive documentation to docs/api/browser/context.md in commit 37380ac, including:

  • configurePrettyDOM options explanation
  • createNodeFilter usage with examples
  • Common filtering patterns
  • Version annotations

*
* // Filter out script, style, and elements with data-test-hide attribute
* utils.configurePrettyDOM({
* filterNode: utils.createNodeFilter('script, style, [data-test-hide]')
Copy link
Member

Choose a reason for hiding this comment

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

Could we just make it accept a string for simplicity? (instead of a function). Then we can delete createNodeFilter

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to accept string directly in commit 7c66451. filterNode now accepts string | ((node: any) => boolean). String values are CSS selectors, and the internal createNodeFilterFromSelector function handles the conversion. Removed createNodeFilter from exports.

expect(result).not.toContain('color: red')
expect(result).not.toContain('hidden content')
expect(result).toContain('visible content')
expect(result).toMatchInlineSnapshot()
Copy link
Member

Choose a reason for hiding this comment

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

You need to run the test so that Vitest generates the snapshot and then commit it, not just add a line of toMatchInlineSnapshot. Also please add toMatchInlineSnapshot to every test that you wrote.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added toMatchInlineSnapshot with expected output to all three filter tests in commit a6927f7.

expect(result).toContain('visible content')

// Reset
utils.configurePrettyDOM({})
Copy link
Member

Choose a reason for hiding this comment

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

Let's add this to beforeEach instead, so that if one of the assertions fails, the reset is still done

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved utils.configurePrettyDOM({}) to beforeEach hook in commit 7c66451, ensuring reset happens even if assertions fail.

Copilot AI and others added 2 commits January 16, 2026 16:29
…deFilter

- Changed filterNode to accept string | function in StringifyOptions
- Added internal createNodeFilterFromSelector function in display.ts
- Removed createNodeFilter from utils export
- Updated all tests to use string selectors directly
- Moved configurePrettyDOM reset to beforeEach hook
- Added toMatchInlineSnapshot to all filter tests
- Updated documentation to reflect simplified API
- Updated type definitions to remove createNodeFilter

Co-authored-by: sheremet-va <16173870+sheremet-va@users.noreply.github.com>
Co-authored-by: sheremet-va <16173870+sheremet-va@users.noreply.github.com>
}
```

### configurePrettyDOM
Copy link
Member

Choose a reason for hiding this comment

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

move the version tag to the head, like in every other page in the documentation. add a custom {#configureprettydom} anchor

do the same for Filtering with CSS Selectors section

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved version tags to heading line and added custom anchors in commit 15d1697:

  • ### configurePrettyDOM <Version>4.1.0</Version> {#configureprettydom}
  • #### Filtering with CSS Selectors <Version>4.1.0</Version> {#filtering-with-css-selectors}

Co-authored-by: sheremet-va <16173870+sheremet-va@users.noreply.github.com>
@sheremet-va
Copy link
Member

@copilot the test is failing because removed elements leave a lot of empty spaces. Could you also handle this use case generally? (Even if elements weren't removed by the filter, but it's just there due to how html works)

Co-authored-by: sheremet-va <16173870+sheremet-va@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 16, 2026

@copilot the test is failing because removed elements leave a lot of empty spaces. Could you also handle this use case generally? (Even if elements weren't removed by the filter, but it's just there d...

Added whitespace filtering in commit 4baa437. The filterChildren function now removes text nodes that contain only whitespace, preventing empty lines in the output both when elements are filtered and in general HTML formatting. This applies regardless of whether a filterNode is provided.

}
return true
})

Copy link
Member

Choose a reason for hiding this comment

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

@copilot remove trailing spaces in the file and don't forget to run linter before commiting

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed trailing spaces from lines 84 and 89, and ran linter in commit 89b3b50.

Co-authored-by: sheremet-va <16173870+sheremet-va@users.noreply.github.com>
@sheremet-va sheremet-va marked this pull request as ready for review January 19, 2026 10:04
@sheremet-va sheremet-va merged commit d3220fc into main Jan 19, 2026
13 of 16 checks passed
@sheremet-va sheremet-va deleted the copilot/add-error-output-filtering branch January 19, 2026 10:05
736-c41-2c1-e464fc974 added a commit to Swiss-Armed-Forces/Loom that referenced this pull request Mar 16, 2026
This MR contains the following updates:

| Package | Type | Update | Change | OpenSSF |
|---|---|---|---|---|
| [@openapitools/openapi-generator-cli](https://github.com/OpenAPITools/openapi-generator-cli) | devDependencies | minor | [`2.29.0` → `2.30.2`](https://renovatebot.com/diffs/npm/@openapitools%2fopenapi-generator-cli/2.29.0/2.30.2) | [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/OpenAPITools/openapi-generator-cli/badge)](https://securityscorecards.dev/viewer/?uri=github.com/OpenAPITools/openapi-generator-cli) |
| [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node) ([source](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node)) | devDependencies | minor | [`24.10.13` → `24.12.0`](https://renovatebot.com/diffs/npm/@types%2fnode/24.10.13/24.12.0) | [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/DefinitelyTyped/DefinitelyTyped/badge)](https://securityscorecards.dev/viewer/?uri=github.com/DefinitelyTyped/DefinitelyTyped) |
| [@typescript-eslint/eslint-plugin](https://typescript-eslint.io/packages/eslint-plugin) ([source](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin)) | devDependencies | minor | [`8.56.1` → `8.57.0`](https://renovatebot.com/diffs/npm/@typescript-eslint%2feslint-plugin/8.56.1/8.57.0) | [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/typescript-eslint/typescript-eslint/badge)](https://securityscorecards.dev/viewer/?uri=github.com/typescript-eslint/typescript-eslint) |
| [@typescript-eslint/parser](https://typescript-eslint.io/packages/parser) ([source](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser)) | devDependencies | minor | [`8.56.1` → `8.57.0`](https://renovatebot.com/diffs/npm/@typescript-eslint%2fparser/8.56.1/8.57.0) | [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/typescript-eslint/typescript-eslint/badge)](https://securityscorecards.dev/viewer/?uri=github.com/typescript-eslint/typescript-eslint) |
| [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react#readme) ([source](https://github.com/vitejs/vite-plugin-react/tree/HEAD/packages/plugin-react)) | devDependencies | minor | [`5.1.4` → `5.2.0`](https://renovatebot.com/diffs/npm/@vitejs%2fplugin-react/5.1.4/5.2.0) | [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/vitejs/vite-plugin-react/badge)](https://securityscorecards.dev/viewer/?uri=github.com/vitejs/vite-plugin-react) |
| [typescript-eslint](https://typescript-eslint.io/packages/typescript-eslint) ([source](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint)) | devDependencies | minor | [`8.56.1` → `8.57.0`](https://renovatebot.com/diffs/npm/typescript-eslint/8.56.1/8.57.0) | [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/typescript-eslint/typescript-eslint/badge)](https://securityscorecards.dev/viewer/?uri=github.com/typescript-eslint/typescript-eslint) |
| [vite-plugin-static-copy](https://github.com/sapphi-red/vite-plugin-static-copy) | devDependencies | minor | [`3.2.0` → `3.3.0`](https://renovatebot.com/diffs/npm/vite-plugin-static-copy/3.2.0/3.3.0) | [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/sapphi-red/vite-plugin-static-copy/badge)](https://securityscorecards.dev/viewer/?uri=github.com/sapphi-red/vite-plugin-static-copy) |
| [vitest](https://vitest.dev) ([source](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest)) | devDependencies | minor | [`4.0.18` → `4.1.0`](https://renovatebot.com/diffs/npm/vitest/4.0.18/4.1.0) | [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/vitest-dev/vitest/badge)](https://securityscorecards.dev/viewer/?uri=github.com/vitest-dev/vitest) |

---

### Release Notes

<details>
<summary>OpenAPITools/openapi-generator-cli (@&#8203;openapitools/openapi-generator-cli)</summary>

### [`v2.30.2`](https://github.com/OpenAPITools/openapi-generator-cli/releases/tag/v2.30.2)

[Compare Source](OpenAPITools/openapi-generator-cli@v2.30.1...v2.30.2)

##### Bug Fixes

- **deps:** update dependency jsonpath to v1.3.0 ([#&#8203;1164](OpenAPITools/openapi-generator-cli#1164)) ([2c4802d](OpenAPITools/openapi-generator-cli@2c4802d))

### [`v2.30.1`](https://github.com/OpenAPITools/openapi-generator-cli/releases/tag/v2.30.1)

[Compare Source](OpenAPITools/openapi-generator-cli@v2.30.0...v2.30.1)

##### Bug Fixes

- **deps:** update dependency fs-extra to v11.3.4 ([#&#8203;1157](OpenAPITools/openapi-generator-cli#1157)) ([74d5871](OpenAPITools/openapi-generator-cli@74d5871))

### [`v2.30.0`](https://github.com/OpenAPITools/openapi-generator-cli/releases/tag/v2.30.0)

[Compare Source](OpenAPITools/openapi-generator-cli@v2.29.0...v2.30.0)

##### Features

- **release:** trigger a release ([#&#8203;1148](OpenAPITools/openapi-generator-cli#1148)) ([a1e9c93](OpenAPITools/openapi-generator-cli@a1e9c93))

</details>

<details>
<summary>typescript-eslint/typescript-eslint (@&#8203;typescript-eslint/eslint-plugin)</summary>

### [`v8.57.0`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8570-2026-03-09)

[Compare Source](typescript-eslint/typescript-eslint@v8.56.1...v8.57.0)

##### 🚀 Features

- **eslint-plugin:** \[no-unnecessary-condition] allow literal loop conditions in for/do loops ([#&#8203;12080](typescript-eslint/typescript-eslint#12080))

##### 🩹 Fixes

- **eslint-plugin:** \[no-base-to-string] fix false positive for toString with overloads ([#&#8203;12089](typescript-eslint/typescript-eslint#12089))
- **eslint-plugin:** \[prefer-promise-reject-errors] add allow `TypeOrValueSpecifier` to prefer-promise-reject-errors ([#&#8203;12094](typescript-eslint/typescript-eslint#12094))
- **typescript-estree:** if the template literal is tagged and the text has an invalid escape, `cooked` will be `null` ([#&#8203;11355](typescript-eslint/typescript-eslint#11355))
- **eslint-plugin:** guard against negative paramIndex in no-useless-default-assignment ([#&#8203;12077](typescript-eslint/typescript-eslint#12077))
- **eslint-plugin:** handle statically analyzable computed keys in prefer-readonly ([#&#8203;12079](typescript-eslint/typescript-eslint#12079))
- **eslint-plugin:** \[strict-void-return] false positives with overloads ([#&#8203;12055](typescript-eslint/typescript-eslint#12055))

##### ❤️ Thank You

- Brad Zacher [@&#8203;bradzacher](https://github.com/bradzacher)
- Brian Schlenker [@&#8203;bschlenk](https://github.com/bschlenk)
- Evyatar Daud [@&#8203;StyleShit](https://github.com/StyleShit)
- James Henry [@&#8203;JamesHenry](https://github.com/JamesHenry)
- Josh Goldberg
- Kirk Waiblinger [@&#8203;kirkwaiblinger](https://github.com/kirkwaiblinger)
- Moses Odutusin [@&#8203;thebolarin](https://github.com/thebolarin)
- Newton Yuan [@&#8203;NewtonYuan](https://github.com/NewtonYuan)
- SungHyun627 [@&#8203;SungHyun627](https://github.com/SungHyun627)
- Younsang Na [@&#8203;nayounsang](https://github.com/nayounsang)

See [GitHub Releases](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.57.0) for more information.

You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.

</details>

<details>
<summary>typescript-eslint/typescript-eslint (@&#8203;typescript-eslint/parser)</summary>

### [`v8.57.0`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/parser/CHANGELOG.md#8570-2026-03-09)

[Compare Source](typescript-eslint/typescript-eslint@v8.56.1...v8.57.0)

This was a version bump only for parser to align it with other projects, there were no code changes.

See [GitHub Releases](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.57.0) for more information.

You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.

</details>

<details>
<summary>vitejs/vite-plugin-react (@&#8203;vitejs/plugin-react)</summary>

### [`v5.2.0`](vitejs/vite-plugin-react@f066114...fda3a86)

[Compare Source](vitejs/vite-plugin-react@f066114...fda3a86)

</details>

<details>
<summary>typescript-eslint/typescript-eslint (typescript-eslint)</summary>

### [`v8.57.0`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/typescript-eslint/CHANGELOG.md#8570-2026-03-09)

[Compare Source](typescript-eslint/typescript-eslint@v8.56.1...v8.57.0)

This was a version bump only for typescript-eslint to align it with other projects, there were no code changes.

See [GitHub Releases](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.57.0) for more information.

You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.

</details>

<details>
<summary>sapphi-red/vite-plugin-static-copy (vite-plugin-static-copy)</summary>

### [`v3.3.0`](https://github.com/sapphi-red/vite-plugin-static-copy/blob/HEAD/CHANGELOG.md#330)

[Compare Source](https://github.com/sapphi-red/vite-plugin-static-copy/compare/vite-plugin-static-copy@3.2.0...vite-plugin-static-copy@3.3.0)

##### Minor Changes

- [#&#8203;230](sapphi-red/vite-plugin-static-copy#230) [`3074e1a`](sapphi-red/vite-plugin-static-copy@3074e1a) Thanks [@&#8203;sapphi-red](https://github.com/sapphi-red)! - Add Vite 8 to peer dependency range.

</details>

<details>
<summary>vitest-dev/vitest (vitest)</summary>

### [`v4.1.0`](https://github.com/vitest-dev/vitest/releases/tag/v4.1.0)

[Compare Source](vitest-dev/vitest@v4.0.18...v4.1.0)

Vitest 4.1 is out!

This release page lists all changes made to the project during the 4.1 beta. To get a review of all the new features, read our [blog post](https://vitest.dev/blog/vitest-4-1).

#####    🚀 Features

- Return a disposable from doMock()  -  by [@&#8203;kirkwaiblinger](https://github.com/kirkwaiblinger) in [#&#8203;9332](vitest-dev/vitest#9332) [<samp>(e3e65)</samp>](vitest-dev/vitest@e3e659a96)
- Added chai style assertions  -  by [@&#8203;ronnakamoto](https://github.com/ronnakamoto) and [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;8842](vitest-dev/vitest#8842) [<samp>(841df)</samp>](vitest-dev/vitest@841df9ac5)
- Update to sinon/fake-timers v15 and add `setTickMode` to timer controls  -  by [@&#8203;atscott](https://github.com/atscott) and [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;8726](vitest-dev/vitest#8726) [<samp>(4b480)</samp>](vitest-dev/vitest@4b480aaed)
- Expose matcher types  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9448](vitest-dev/vitest#9448) [<samp>(3e4b9)</samp>](vitest-dev/vitest@3e4b913b1)
- Add `toTestSpecification` to reported tasks  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9464](vitest-dev/vitest#9464) [<samp>(1a470)</samp>](vitest-dev/vitest@1a4705da9)
- Show a warning if `vi.mock` or `vi.hoisted` are declared outside of top level of the module  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9387](vitest-dev/vitest#9387) [<samp>(5db54)</samp>](vitest-dev/vitest@5db54a468)
- Track and display expectedly failed tests (.fails) in UI and CLI  -  by [@&#8203;Copilot](https://github.com/Copilot), **sheremet-va** and [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9476](vitest-dev/vitest#9476) [<samp>(77d75)</samp>](vitest-dev/vitest@77d75fd34)
- Support tags  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9478](vitest-dev/vitest#9478) [<samp>(de7c8)</samp>](vitest-dev/vitest@de7c8a521)
- Implement `aroundEach` and `aroundAll` hooks  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9450](vitest-dev/vitest#9450) [<samp>(2a8cb)</samp>](vitest-dev/vitest@2a8cb9dc2)
- Stabilize experimental features  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9529](vitest-dev/vitest#9529) [<samp>(b5fd2)</samp>](vitest-dev/vitest@b5fd2a16a)
- Accept `new` or `all` in `--update` flag  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9543](vitest-dev/vitest#9543) [<samp>(a5acf)</samp>](vitest-dev/vitest@a5acf28a5)
- Support `meta` in test options  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9535](vitest-dev/vitest#9535) [<samp>(7d622)</samp>](vitest-dev/vitest@7d622e3d1)
- Support type inference with a new `test.extend` syntax  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9550](vitest-dev/vitest#9550) [<samp>(e5385)</samp>](vitest-dev/vitest@e53854fcc)
- Support vite 8 beta, fix type issues in the config with different vite versions  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9587](vitest-dev/vitest#9587) [<samp>(99028)</samp>](vitest-dev/vitest@990281dfd)
- Add assertion helper to hide internal stack traces  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) and **Claude Opus 4.6** in [#&#8203;9594](vitest-dev/vitest#9594) [<samp>(eeb0a)</samp>](vitest-dev/vitest@eeb0ae2f8)
- Store failure screenshots using artifacts API  -  by [@&#8203;macarie](https://github.com/macarie) in [#&#8203;9588](vitest-dev/vitest#9588) [<samp>(24603)</samp>](vitest-dev/vitest@24603e3c4)
- Allow `vitest list` to statically collect tests instead of running files to collect them  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9630](vitest-dev/vitest#9630) [<samp>(7a8e7)</samp>](vitest-dev/vitest@7a8e7fc20)
- Add `--detect-async-leaks`  -  by [@&#8203;AriPerkkio](https://github.com/AriPerkkio) in [#&#8203;9528](vitest-dev/vitest#9528) [<samp>(c594d)</samp>](vitest-dev/vitest@c594d4af3)
- Implement `mockThrow` and `mockThrowOnce`  -  by [@&#8203;thor-juhasz](https://github.com/thor-juhasz) and [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9512](vitest-dev/vitest#9512) [<samp>(61917)</samp>](vitest-dev/vitest@619179fb7)
- Support `update: "none"` and add docs about snapshots behavior on CI  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) in [#&#8203;9700](vitest-dev/vitest#9700) [<samp>(05f18)</samp>](vitest-dev/vitest@05f1854e2)
- Support playwright `launchOptions` with `connectOptions`  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) in [#&#8203;9702](vitest-dev/vitest#9702) [<samp>(f0ff1)</samp>](vitest-dev/vitest@f0ff1b2a0)
- Add `page/locator.mark` API to enhance playwright trace  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) in [#&#8203;9652](vitest-dev/vitest#9652) [<samp>(d0ee5)</samp>](vitest-dev/vitest@d0ee546fe)
- **api**:
  - Support tests starting or ending with `test` in `experimental_parseSpecification`  -  by [@&#8203;jgillick](https://github.com/jgillick) and **Jeremy Gillick** in [#&#8203;9235](vitest-dev/vitest#9235) [<samp>(2f367)</samp>](vitest-dev/vitest@2f367fad3)
  - Add filters to `createSpecification`  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9336](vitest-dev/vitest#9336) [<samp>(c8e6c)</samp>](vitest-dev/vitest@c8e6c7fbf)
  - Expose `runTestFiles` as alternative to `runTestSpecifications`  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9443](vitest-dev/vitest#9443) [<samp>(43d76)</samp>](vitest-dev/vitest@43d761821)
  - Add `allowWrite` and `allowExec` options to `api`  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9350](vitest-dev/vitest#9350) [<samp>(20e00)</samp>](vitest-dev/vitest@20e00ef78)
  - Allow passing down test cases to `toTestSpecification`  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9627](vitest-dev/vitest#9627) [<samp>(6f17d)</samp>](vitest-dev/vitest@6f17d5ddf)
- **browser**:
  - Add `userEvent.wheel` API  -  by [@&#8203;macarie](https://github.com/macarie) in [#&#8203;9188](vitest-dev/vitest#9188) [<samp>(66080)</samp>](vitest-dev/vitest@660801979)
  - Add `filterNode` option to prettyDOM for filtering browser assertion error output  -  by [@&#8203;Copilot](https://github.com/Copilot), **sheremet-va** and [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9475](vitest-dev/vitest#9475) [<samp>(d3220)</samp>](vitest-dev/vitest@d3220fcd8)
  - Support playwright persistent context  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa), **Claude Opus 4.6** and [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9229](vitest-dev/vitest#9229) [<samp>(f865d)</samp>](vitest-dev/vitest@f865d2ba4)
  - Added `detailsPanelPosition` option and button  -  by [@&#8203;shairez](https://github.com/shairez) in [#&#8203;9525](vitest-dev/vitest#9525) [<samp>(c8a31)</samp>](vitest-dev/vitest@c8a31147c)
  - Use BlazeDiff instead of pixelmatch  -  by [@&#8203;macarie](https://github.com/macarie) in [#&#8203;9514](vitest-dev/vitest#9514) [<samp>(30936)</samp>](vitest-dev/vitest@309362089)
  - Add `findElement` and enable strict mode in webdriverio and preview  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9677](vitest-dev/vitest#9677) [<samp>(c3f37)</samp>](vitest-dev/vitest@c3f37721c)
- **cli**:
  - Add [@&#8203;bomb](https://github.com/bomb).sh/tab completions  -  by [@&#8203;AmirSa12](https://github.com/AmirSa12) and [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;8639](vitest-dev/vitest#8639) [<samp>(200f3)</samp>](vitest-dev/vitest@200f31704)
- **coverage**:
  - Support `ignore start/stop` ignore hints  -  by [@&#8203;AriPerkkio](https://github.com/AriPerkkio) in [#&#8203;9204](vitest-dev/vitest#9204) [<samp>(e59c9)</samp>](vitest-dev/vitest@e59c94ba6)
  - Add `coverage.changed` option to report only changed files  -  by [@&#8203;kykim00](https://github.com/kykim00) and [@&#8203;AriPerkkio](https://github.com/AriPerkkio) in [#&#8203;9521](vitest-dev/vitest#9521) [<samp>(1d939)</samp>](vitest-dev/vitest@1d9392c67)
- **experimental**:
  - Add `onModuleRunner` hook to `worker.init`  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9286](vitest-dev/vitest#9286) [<samp>(e977f)</samp>](vitest-dev/vitest@e977f3deb)
  - Option to disable the module runner  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) and [@&#8203;AriPerkkio](https://github.com/AriPerkkio) in [#&#8203;9210](vitest-dev/vitest#9210) [<samp>(9be61)</samp>](vitest-dev/vitest@9be6121ee)
  - Add `importDurations: { limit, print }` options  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa), **Claude Opus 4.6** and [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9401](vitest-dev/vitest#9401) [<samp>(7e10f)</samp>](vitest-dev/vitest@7e10fb356)
  - Add print and fail thresholds for `importDurations`  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) and **Claude Opus 4.6** in [#&#8203;9533](vitest-dev/vitest#9533) [<samp>(3f7a5)</samp>](vitest-dev/vitest@3f7a5f8f8)
- **fixtures**:
  - Pass down file context to `beforeAll`/`afterAll`  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9572](vitest-dev/vitest#9572) [<samp>(c8339)</samp>](vitest-dev/vitest@c83395f2c)
- **reporters**:
  - Add `agent` reporter to reduce ai agent token usage  -  by [@&#8203;cpojer](https://github.com/cpojer) in [#&#8203;9779](vitest-dev/vitest#9779) [<samp>(3e9e0)</samp>](vitest-dev/vitest@3e9e096a2)
- **runner**:
  - Enhance `retry` options  -  by [@&#8203;MazenSamehR](https://github.com/MazenSamehR), **Matan Shavit**, [@&#8203;AriPerkkio](https://github.com/AriPerkkio) and [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9370](vitest-dev/vitest#9370) [<samp>(9e4cf)</samp>](vitest-dev/vitest@9e4cfd295)
- **ui**:
  - Allow run individual test/suites  -  by [@&#8203;userquin](https://github.com/userquin) in [#&#8203;9465](vitest-dev/vitest#9465) [<samp>(73b10)</samp>](vitest-dev/vitest@73b10f1b9)
  - Add project filter/sort support  -  by [@&#8203;userquin](https://github.com/userquin) in [#&#8203;8689](vitest-dev/vitest#8689) [<samp>(0c7ea)</samp>](vitest-dev/vitest@0c7eaac16)
  - Add duration sorting to explorer  -  by [@&#8203;julianhahn](https://github.com/julianhahn) and [@&#8203;cursoragent](https://github.com/cursoragent) in [#&#8203;9603](vitest-dev/vitest#9603) [<samp>(209b1)</samp>](vitest-dev/vitest@209b1b0e1)
  - Implement filter for slow tests  -  by [@&#8203;DerYeger](https://github.com/DerYeger) and [@&#8203;userquin](https://github.com/userquin) in [#&#8203;9705](vitest-dev/vitest#9705) [<samp>(8880c)</samp>](vitest-dev/vitest@8880c907a)
- **vitest**:
  - Add run summary in GitHub Actions Reporter  -  by [@&#8203;macarie](https://github.com/macarie) and **jhnance** in [#&#8203;9579](vitest-dev/vitest#9579) [<samp>(96bfc)</samp>](vitest-dev/vitest@96bfc8345)

#####    🐞 Bug Fixes

- Deprecate several vitest/\* entry points  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9347](vitest-dev/vitest#9347) [<samp>(fd459)</samp>](vitest-dev/vitest@fd45928be)
- Use `meta.url` in `createRequire`  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9441](vitest-dev/vitest#9441) [<samp>(e3422)</samp>](vitest-dev/vitest@e34225563)
- Preact browser mode init example of render function not async  -  by [@&#8203;WuMingDao](https://github.com/WuMingDao) in [#&#8203;9375](vitest-dev/vitest#9375) [<samp>(2bea5)</samp>](vitest-dev/vitest@2bea549c7)
- Deprecate unused types in matcher context  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9449](vitest-dev/vitest#9449) [<samp>(20f87)</samp>](vitest-dev/vitest@20f8753a2)
- Handle `external/noExternal` during `configEnvironment` hook  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) and **Claude Opus 4.6** in [#&#8203;9508](vitest-dev/vitest#9508) [<samp>(59ea2)</samp>](vitest-dev/vitest@59ea27c1c)
- Replace default ssr environment runner with Vitest server module runner  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) and **Claude Opus 4.6** in [#&#8203;9506](vitest-dev/vitest#9506) [<samp>(cd5db)</samp>](vitest-dev/vitest@cd5db660c)
- Propagate experimental CLI options to child projects  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) and **Claude Opus 4.6** in [#&#8203;9531](vitest-dev/vitest#9531) [<samp>(b624f)</samp>](vitest-dev/vitest@b624fae53)
- Show a warning when `browser.isolate` is used  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9410](vitest-dev/vitest#9410) [<samp>(3d48e)</samp>](vitest-dev/vitest@3d48ebcb9)
- Fix `vi.mock({ spy: true })` node v8 coverage  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa), **hi-ogawa** and **Claude Opus 4.6** in [#&#8203;9541](vitest-dev/vitest#9541) [<samp>(687b6)</samp>](vitest-dev/vitest@687b633c1)
- Don't show internal ssr handler in errors  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9547](vitest-dev/vitest#9547) [<samp>(76c43)</samp>](vitest-dev/vitest@76c4397b5)
- Close vitest if it failed to start  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9573](vitest-dev/vitest#9573) [<samp>(728ba)</samp>](vitest-dev/vitest@728ba617f)
- Fix ssr environment runner in project  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) in [#&#8203;9584](vitest-dev/vitest#9584) [<samp>(09006)</samp>](vitest-dev/vitest@090064f97)
- Trim trailing white spaces in code block  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) in [#&#8203;9591](vitest-dev/vitest#9591) [<samp>(f78be)</samp>](vitest-dev/vitest@f78bea992)
- Support inline snapshot inside test.for/each  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) in [#&#8203;9590](vitest-dev/vitest#9590) [<samp>(615fd)</samp>](vitest-dev/vitest@615fd521e)
- Apply source maps for external module stack trace  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) in [#&#8203;9152](vitest-dev/vitest#9152) [<samp>(79e20)</samp>](vitest-dev/vitest@79e20d5a3)
- Remove the `.name` from statically collected test  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9596](vitest-dev/vitest#9596) [<samp>(b66ff)</samp>](vitest-dev/vitest@b66ff691a)
- Don't suppress warnings on pnp  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9602](vitest-dev/vitest#9602) [<samp>(89cbd)</samp>](vitest-dev/vitest@89cbdaea3)
- Support snapshot with `expect.soft`  -  by [@&#8203;iumehara](https://github.com/iumehara), [@&#8203;hi-ogawa](https://github.com/hi-ogawa) and **Claude Opus 4.6** in [#&#8203;9231](vitest-dev/vitest#9231) [<samp>(3eb2c)</samp>](vitest-dev/vitest@3eb2cd541)
- Log seed when only `sequence.shuffle.tests` is enabled  -  by [@&#8203;kaigritun](https://github.com/kaigritun), **Kai Gritun** and [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9576](vitest-dev/vitest#9576) [<samp>(8182b)</samp>](vitest-dev/vitest@8182b77ad)
- Externalize `expect/src/utils` from `vitest`  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) in [#&#8203;9616](vitest-dev/vitest#9616) [<samp>(48739)</samp>](vitest-dev/vitest@487398422)
- Ignore test.override during static collection  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9620](vitest-dev/vitest#9620) [<samp>(09174)</samp>](vitest-dev/vitest@0917470ce)
- Increase stacktrace limit for `--detect-async-leaks`  -  by [@&#8203;AriPerkkio](https://github.com/AriPerkkio) in [#&#8203;9638](vitest-dev/vitest#9638) [<samp>(9fd4c)</samp>](vitest-dev/vitest@9fd4ce533)
- Hanging-reporter link in cli  -  by [@&#8203;flx-sta](https://github.com/flx-sta) in [#&#8203;9649](vitest-dev/vitest#9649) [<samp>(7c103)</samp>](vitest-dev/vitest@7c103055c)
- Fix teardown timeout of `aroundEach/All` when inner `aroundEach/All` throws  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) in [#&#8203;9657](vitest-dev/vitest#9657) [<samp>(4ec6c)</samp>](vitest-dev/vitest@4ec6cb305)
- Fix ui mode / html reporter and coverage integration  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) and **Claude Opus 4.6** in [#&#8203;9626](vitest-dev/vitest#9626) [<samp>(86fad)</samp>](vitest-dev/vitest@86fad4b42)
- Don't continue when `aroundEach/All` setup timed out  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) in [#&#8203;9670](vitest-dev/vitest#9670) [<samp>(bb013)</samp>](vitest-dev/vitest@bb013d54b)
- Align `VitestRunnerConfig` optional fields with `SerializedConfig`  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) in [#&#8203;9661](vitest-dev/vitest#9661) [<samp>(79520)</samp>](vitest-dev/vitest@79520d82d)
- Handle Symbol values in format utility  -  by [@&#8203;nami8824](https://github.com/nami8824) in [#&#8203;9658](vitest-dev/vitest#9658) [<samp>(0583f)</samp>](vitest-dev/vitest@0583f067e)
- Deprecate `toBe*` spy assertions in favor of `toHaveBeen*` (and `toThrowError`)  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9665](vitest-dev/vitest#9665) [<samp>(4d390)</samp>](vitest-dev/vitest@4d390dfe9)
- Don't propagate nested `aroundEach/All` errors but aggregate them on runner  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) in [#&#8203;9673](vitest-dev/vitest#9673) [<samp>(b6365)</samp>](vitest-dev/vitest@b63653f5a)
- Show a better error if there is a pending dynamic import  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9676](vitest-dev/vitest#9676) [<samp>(7ef5c)</samp>](vitest-dev/vitest@7ef5cf4b7)
- Preserve stack trace of `resolves/rejects` chained assertion error  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) in [#&#8203;9679](vitest-dev/vitest#9679) [<samp>(c6151)</samp>](vitest-dev/vitest@c61511d4a)
- Handle module-sync condition in vmThreads/vmForks require  -  by [@&#8203;lesleh](https://github.com/lesleh) in [#&#8203;9650](vitest-dev/vitest#9650) and [#&#8203;9651](vitest-dev/vitest#9651) [<samp>(bb203)</samp>](vitest-dev/vitest@bb20389f4)
- Hooks should respect `maxConcurrency`  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) in [#&#8203;9653](vitest-dev/vitest#9653) [<samp>(16d13)</samp>](vitest-dev/vitest@16d13d981)
- Recursively autospy module object  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) in [#&#8203;9687](vitest-dev/vitest#9687) [<samp>(695a8)</samp>](vitest-dev/vitest@695a86b41)
- Remove trailing spaces from diff error log  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) and [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9680](vitest-dev/vitest#9680) [<samp>(395d1)</samp>](vitest-dev/vitest@395d1a29e)
- Respect project `resolve.conditions` for externals  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) in [#&#8203;9717](vitest-dev/vitest#9717) [<samp>(1d498)</samp>](vitest-dev/vitest@1d4987498)
- Use object for WeakMap instead of a symbol to support webcontainers  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9731](vitest-dev/vitest#9731) [<samp>(c5225)</samp>](vitest-dev/vitest@c52259330)
- Fix re-mocking virtual module  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) in [#&#8203;9748](vitest-dev/vitest#9748) [<samp>(3cbbb)</samp>](vitest-dev/vitest@3cbbb17f1)
- Cancelling should stop current test immediately  -  by [@&#8203;AriPerkkio](https://github.com/AriPerkkio) in [#&#8203;9729](vitest-dev/vitest#9729) [<samp>(0cb2f)</samp>](vitest-dev/vitest@0cb2f7239)
- Make `mockObject` change backwards compatible  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9744](vitest-dev/vitest#9744) [<samp>(84c69)</samp>](vitest-dev/vitest@84c69497f)
- Fix `URL.name` on jsdom  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) in [#&#8203;9767](vitest-dev/vitest#9767) [<samp>(031f3)</samp>](vitest-dev/vitest@031f3a374)
- Save and restore module graph in blob reporter  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) in [#&#8203;9740](vitest-dev/vitest#9740) [<samp>(84355)</samp>](vitest-dev/vitest@843554bf0)
- Don't silence reporter errors from test runtime events handler in normal run and --merge-reports  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) in [#&#8203;9727](vitest-dev/vitest#9727) [<samp>(4072d)</samp>](vitest-dev/vitest@4072d0132)
- Fix `vi.importActual()` for virtual modules  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) and **Claude Opus 4.6** in [#&#8203;9772](vitest-dev/vitest#9772) [<samp>(1e89e)</samp>](vitest-dev/vitest@1e89ec020)
- Throw `FixtureAccessError` if suite hook accesses undefined fixture  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9786](vitest-dev/vitest#9786) [<samp>(fc2ce)</samp>](vitest-dev/vitest@fc2cea2b7)
- Allow hyphens in project config file name pattern  -  by [@&#8203;Koutaro-Hanabusa](https://github.com/Koutaro-Hanabusa) and [@&#8203;hi-ogawa](https://github.com/hi-ogawa) in [#&#8203;9760](vitest-dev/vitest#9760) [<samp>(33e96)</samp>](vitest-dev/vitest@33e96311a)
- Manual and redirect mock shouldn't `load` or `transform` original module  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) and **Claude Opus 4.6** in [#&#8203;9774](vitest-dev/vitest#9774) [<samp>(a8216)</samp>](vitest-dev/vitest@a8216b001)
- `hideSkippedTests` should not hide `test.todo`  -  by [@&#8203;oilater](https://github.com/oilater) in [#&#8203;9562](vitest-dev/vitest#9562) and [#&#8203;9781](vitest-dev/vitest#9781) [<samp>(8181e)</samp>](vitest-dev/vitest@8181e06e7)
- Allow catch/finally for async assertion  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) in [#&#8203;9827](vitest-dev/vitest#9827) [<samp>(031f0)</samp>](vitest-dev/vitest@031f02a89)
- Resolve fixture overrides from test's suite in `beforeEach` hooks  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) and **Claude Opus 4.6** in [#&#8203;9826](vitest-dev/vitest#9826) [<samp>(99e52)</samp>](vitest-dev/vitest@99e52fe58)
- Use isAgent check, not just TTY, for watch mode  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9841](vitest-dev/vitest#9841) [<samp>(c3cac)</samp>](vitest-dev/vitest@c3cac1c1b)
- Use `performance.now` to measure test timeout duration  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) and **Claude Opus 4.6** in [#&#8203;9795](vitest-dev/vitest#9795) [<samp>(f48a6)</samp>](vitest-dev/vitest@f48a60114)
- Correctly identify concurrent test during static analysis  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9846](vitest-dev/vitest#9846) [<samp>(1de0a)</samp>](vitest-dev/vitest@1de0aa22d)
- **browser**:
  - Avoid updating screenshots when `toMatchScreenshot` passes  -  by [@&#8203;macarie](https://github.com/macarie) in [#&#8203;9289](vitest-dev/vitest#9289) [<samp>(46aab)</samp>](vitest-dev/vitest@46aabaa44)
  - Hide injected data-testid attributes  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9503](vitest-dev/vitest#9503) [<samp>(c8d2c)</samp>](vitest-dev/vitest@c8d2c411c)
  - Throw an error if iframe was reloaded  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9516](vitest-dev/vitest#9516) [<samp>(73a81)</samp>](vitest-dev/vitest@73a81f880)
  - Encode projectName in browser client URL  -  by [@&#8203;dkkim0122](https://github.com/dkkim0122) in [#&#8203;9523](vitest-dev/vitest#9523) [<samp>(5b164)</samp>](vitest-dev/vitest@5b16483c3)
  - Don't take failure screenshot if tests have artifacts created by `toMatchScreenshot`  -  by [@&#8203;macarie](https://github.com/macarie) in [#&#8203;9552](vitest-dev/vitest#9552) [<samp>(83ca0)</samp>](vitest-dev/vitest@83ca02547)
  - Remove `--remote-debugging-address` from chrome args  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) and [@&#8203;AriPerkkio](https://github.com/AriPerkkio) in [#&#8203;9712](vitest-dev/vitest#9712) [<samp>(f09bb)</samp>](vitest-dev/vitest@f09bb5c32)
  - Make sure userEvent actions support `ensureAwaited`  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9732](vitest-dev/vitest#9732) [<samp>(97685)</samp>](vitest-dev/vitest@9768517b8)
  - Types of `getCDPSession` and `cdp()`  -  by [@&#8203;AriPerkkio](https://github.com/AriPerkkio) in [#&#8203;9716](vitest-dev/vitest#9716) [<samp>(689a2)</samp>](vitest-dev/vitest@689a22a1b)
  - Skip esbuild.legalComments when using rolldown-vite  -  by [@&#8203;Copilot](https://github.com/Copilot), **hi-ogawa** and [@&#8203;hi-ogawa](https://github.com/hi-ogawa) in [#&#8203;9803](vitest-dev/vitest#9803) [<samp>(3505f)</samp>](vitest-dev/vitest@3505fa5a3)
- **chai**:
  - Don't allow `deepEqual` in the config because it's not serializable  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9666](vitest-dev/vitest#9666) [<samp>(9ee99)</samp>](vitest-dev/vitest@9ee999d73)
- **coverage**:
  - Infer transform mode for uncovered files  -  by [@&#8203;AriPerkkio](https://github.com/AriPerkkio) in [#&#8203;9435](vitest-dev/vitest#9435) [<samp>(f3967)</samp>](vitest-dev/vitest@f396792d6)
  - `thresholds.autoUpdate` to preserve ending whitespace  -  by [@&#8203;AriPerkkio](https://github.com/AriPerkkio) in [#&#8203;9436](vitest-dev/vitest#9436) [<samp>(7e534)</samp>](vitest-dev/vitest@7e534a0b6)
- **deps**:
  - Update all non-major dependencies  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) in [#&#8203;9192](vitest-dev/vitest#9192) [<samp>(90c30)</samp>](vitest-dev/vitest@90c302f3b)
  - Update all non-major dependencies  -  in [#&#8203;9485](vitest-dev/vitest#9485) [<samp>(c0118)</samp>](vitest-dev/vitest@c01186022)
  - Update all non-major dependencies  -  in [#&#8203;9567](vitest-dev/vitest#9567) [<samp>(13c9e)</samp>](vitest-dev/vitest@13c9e022b)
- **docs**:
  - Fix old `/config/#option` hash links causing hydration errors  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa), **Claude Opus 4.6** and [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9610](vitest-dev/vitest#9610) [<samp>(a603c)</samp>](vitest-dev/vitest@a603c3a30)
- **expect**:
  - `toMatchObject(Map/Set)` should expect `Map/Set` on left hand side  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) and **Claude Opus 4.6** in [#&#8203;9532](vitest-dev/vitest#9532) [<samp>(381da)</samp>](vitest-dev/vitest@381da4a9d)
  - Fix objectContaining with proxy  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) and **Claude Opus 4.6** in [#&#8203;9554](vitest-dev/vitest#9554) [<samp>(7ce34)</samp>](vitest-dev/vitest@7ce3417b1)
  - Support arbitrary value equality for `toThrow` and make Error detection robust  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa) and **Claude Opus 4.6** in [#&#8203;9570](vitest-dev/vitest#9570) [<samp>(de215)</samp>](vitest-dev/vitest@de215c19c)
- **mock**:
  - Inject helpers after hashbang if present  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9545](vitest-dev/vitest#9545) [<samp>(65432)</samp>](vitest-dev/vitest@65432a74b)
- **mocker**:
  - Update vite's peer dependency range  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9808](vitest-dev/vitest#9808) [<samp>(36f9a)</samp>](vitest-dev/vitest@36f9a81a2)
- **reporter**:
  - `dot` reporter leaves pending tests  -  by [@&#8203;AriPerkkio](https://github.com/AriPerkkio) in [#&#8203;9684](vitest-dev/vitest#9684) [<samp>(4d793)</samp>](vitest-dev/vitest@4d7938a56)
- **runner**:
  - Mark repeated tests as finished on last run  -  by [@&#8203;AriPerkkio](https://github.com/AriPerkkio) in [#&#8203;9707](vitest-dev/vitest#9707) [<samp>(cc735)</samp>](vitest-dev/vitest@cc735970a)
- **spy**:
  - Support deep partial in vi.mocked  -  by [@&#8203;j2h30728](https://github.com/j2h30728) in [#&#8203;8152](vitest-dev/vitest#8152) and [#&#8203;9493](vitest-dev/vitest#9493) [<samp>(71cb5)</samp>](vitest-dev/vitest@71cb51ffc)
  - Fallback to object accessor if descriptor's value is `undefined`  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9511](vitest-dev/vitest#9511) [<samp>(6f181)</samp>](vitest-dev/vitest@6f18103fa)
  - Throw correct errors when shorthand methods are used on a class  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9513](vitest-dev/vitest#9513) [<samp>(5d0fd)</samp>](vitest-dev/vitest@5d0fd3b62)
- **types**:
  - `bench.reporters` no longer gives type errors when passing file name string paths  -  by [@&#8203;Bertie690](https://github.com/Bertie690) in [#&#8203;9695](vitest-dev/vitest#9695) [<samp>(093c8)</samp>](vitest-dev/vitest@093c8f6b5)
- **ui**:
  - Process artifact attachments when generating HTML reporter  -  by [@&#8203;macarie](https://github.com/macarie) in [#&#8203;9472](vitest-dev/vitest#9472) [<samp>(96eb9)</samp>](vitest-dev/vitest@96eb92826)
  - Don't fail if --ui and --root are specified together  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9536](vitest-dev/vitest#9536) [<samp>(d9305)</samp>](vitest-dev/vitest@d93055fc7)

#####    🏎 Performance

- **pretty-format**: Combine DOMElement plugins  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;9581](vitest-dev/vitest#9581) [<samp>(da85a)</samp>](vitest-dev/vitest@da85a3267)

#####     [View changes on GitHub](vitest-dev/vitest@v4.0.17...v4.1.0)

</details>

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My41OS4zIiwidXBkYXRlZEluVmVyIjoiNDMuNjYuNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIiwicmVub3ZhdGUiXX0=-->

See merge request swiss-armed-forces/cyber-command/cea/loom!361

Co-authored-by: Loom MR Pipeline Trigger <group_103951964_bot_9504bb8dead6d4e406ad817a607f24be@noreply.gitlab.com>
Co-authored-by: shrewd-laidback palace <shrewd-laidback-palace-736-c41-2c1-e464fc974@swiss-armed-forces-open-source.ch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add assertion error output filtering option(s) for browser mode

2 participants