Skip to content

refactor: copy attachmentsDir in html reporter output#9632

Merged
sheremet-va merged 5 commits intovitest-dev:mainfrom
hi-ogawa:02-11-refactor_html_reporter_and_attachments
Feb 12, 2026
Merged

refactor: copy attachmentsDir in html reporter output#9632
sheremet-va merged 5 commits intovitest-dev:mainfrom
hi-ogawa:02-11-refactor_html_reporter_and_attachments

Conversation

@hi-ogawa
Copy link
Copy Markdown
Collaborator

@hi-ogawa hi-ogawa commented Feb 11, 2026

Description

I wasn't sure html reporter needs to traverse each attachment. This simplifies it by simple copy of attachmentsDir. Also keep attachment.body for data url on UI. The test case is added to verify it (though there's minor bug as per #9633).

As indicated in TODO, eventually I'm looking into unify attachmentsDir and html outputFile, so no copy is needed from html reporter side.

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

hi-ogawa and others added 5 commits February 11, 2026 14:46
The explorer sidebar uses RecycleScroller which only renders items
within the viewport. With more test fixtures, some items were not
rendered at the default 720px height, causing locator failures.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@hi-ogawa hi-ogawa changed the title refactor: html reporter and attachments refactor: copy attachmentsDir in html reporter output Feb 11, 2026
@hi-ogawa hi-ogawa marked this pull request as ready for review February 11, 2026 07:42
Copy link
Copy Markdown
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.

What if attachment has a custom path?

@hi-ogawa
Copy link
Copy Markdown
Collaborator Author

What if attachment has a custom path?

What is a custom path? Doesn't Vitest copy all inside attachmentsDir?

@sheremet-va
Copy link
Copy Markdown
Member

What if attachment has a custom path?

What is a custom path? Doesn't Vitest copy all inside attachmentsDir?

Hm, you are right, it just copies it into attachmentsDir

@sheremet-va sheremet-va merged commit 7c94c17 into vitest-dev:main Feb 12, 2026
15 of 16 checks passed
@hi-ogawa hi-ogawa deleted the 02-11-refactor_html_reporter_and_attachments branch February 12, 2026 09:36
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.

2 participants