Skip to content

Conversation

@sheremet-va
Copy link
Member

@sheremet-va sheremet-va commented May 12, 2025

Description

Fixes #7940

TODO

  • Test
  • Docs

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

@netlify
Copy link

netlify bot commented May 12, 2025

Deploy Preview for vitest-dev ready!

Name Link
🔨 Latest commit 9abf502
🔍 Latest deploy log https://app.netlify.com/sites/vitest-dev/deploys/682348320f42ed0008b279bb
😎 Deploy Preview https://deploy-preview-7968--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 site configuration.

@sheremet-va sheremet-va requested a review from Copilot May 13, 2025 13:15
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an unhandled error tracking issue by modifying error listener behavior, adding tests and updating documentation.

  • Changes test files to validate unhandled error behavior.
  • Updates the error listener logic in the runtime execution code.
  • Updates documentation and snapshots to reflect the new error reporting behavior.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/core/test/unhandled.test.ts Added test for unhandled promise error handling.
test/cli/test/snapshots/fails.test.ts.snap Updated snapshot output for unhandled errors.
test/cli/fixtures/fails/unhandled-suite.test.ts Added an additional test suite for unhandled errors.
packages/vitest/src/runtime/execute.ts Modified error listener logic by removing the test-specific condition.
docs/guide/features.md Added a documentation section on reporting uncaught errors.
docs/.vitepress/components/FeaturesList.vue Updated feature list to include error reporting.
README.md Updated feature list to include reporting of uncaught errors.
Comments suppressed due to low confidence (1)

packages/vitest/src/runtime/execute.ts:60

  • The removal of the test-specific error handling condition may affect how unhandled errors during tests are processed; please verify that this change does not inadvertently suppress errors that should be reported.
if (worker.current?.type === 'test') {

Co-authored-by: Copilot <[email protected]>
@sheremet-va sheremet-va merged commit 464218f into vitest-dev:main May 13, 2025
12 of 13 checks passed
@sheremet-va sheremet-va deleted the fix/always-catch-errors branch May 13, 2025 17:29
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.

Can't catch unhandled errors/rejections since 3.0.8

1 participant