Skip to content

Conversation

@macarie
Copy link
Member

@macarie macarie commented Oct 25, 2025

Description

This PR adds a new failure view for toMatchScreenshot in the report panel. The view displays diff, reference, and actual screenshots in separate tabs, with a slider tab for side-by-side comparison. Under the hood, this feature is implemented using the new artifacts API.

Preview:

slider-demo-h264.mp4

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.
  • Please check Allow edits by maintainers to make review process faster. Note that this option is not available for repositories that are owned by Github organizations.

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:.

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.

I like the direction of this, but I wonder if instead of adding a separate artifact entity, we can just extend attachments with additional fields, but have them as @private? The two share a lot of similarities and it's hard to justify the separation, to be honest.

I feel like in the future we could also make the API public, the metadata seems useful

@macarie

This comment was marked as duplicate.

@sheremet-va
Copy link
Member

Can't all of the new required fields just go into an artifact field? The message can be set to '' until the next major. And attachments can be added to TestAnnotation alongside the attachment as an @experimental feature

@netlify
Copy link

netlify bot commented Oct 29, 2025

Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 9287be4
🔍 Latest deploy log https://app.netlify.com/projects/vitest-dev/deploys/6902479acc6d66000800c3e4
😎 Deploy Preview https://deploy-preview-8813--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.

@macarie macarie force-pushed the feat/artifacts branch 2 times, most recently from 9287be4 to c239bf0 Compare October 29, 2025 21:21
@macarie macarie force-pushed the feat/artifacts branch 4 times, most recently from b9660bf to ddaa9a8 Compare November 20, 2025 13:41
Comment on lines +9 to +11
optimizeDeps: {
include: ['vue-router', 'splitpanes', 'd3-graph-controller', 'vue-virtual-scroller'],
},
Copy link
Member Author

Choose a reason for hiding this comment

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

Not entirely sure about this, but without it Vite would trigger a reload and hang the test until the pipeline reaches the 30m timeout: https://github.com/vitest-dev/vitest/actions/runs/19538883275/job/55939684333?pr=8813

@macarie macarie marked this pull request as ready for review November 20, 2025 14:58
@macarie macarie requested a review from userquin November 20, 2025 15:01
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.

Found a bug. I was using expect-dom/toMatchScreenshot to test this, not sure if it was a good idea, but if you click between different tests, the screenshots are lost:

Screen.Recording.2025-11-21.at.17.37.21.mov

@macarie
Copy link
Member Author

macarie commented Nov 22, 2025

Should be fixed now @sheremet-va. Noticed Vue reused the node when switching test results so "Reference" moved to the left, that should be fixed now too.

@sheremet-va sheremet-va merged commit c37c2eb into vitest-dev:main Nov 25, 2025
14 of 16 checks passed
@sheremet-va
Copy link
Member

Thank you!

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.

3 participants