Skip to content

Conversation

@Livan-pro
Copy link
Contributor

Description

This PR fixes an issue with the incorrect encoding of the Uint8Array body in test annotations. The root cause is that the table for base64 encoding is missing characters at indices 62 and 63. This bug causes "undefined" to appear in the base64-encoded body. I've figured this out while trying to view image annotations in an HTML report. They were not loading.
Reproducible in Vitest v4.0.7 (and I believe since the introduction of annotations in v3.2.0).

I didn't find a reported issue on GitHub.

BTW, I have a small question. Is there a reason to use for loops to populate the table instead of a simple const table = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'? 🤔

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

@netlify
Copy link

netlify bot commented Nov 6, 2025

Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit aa2d45b
🔍 Latest deploy log https://app.netlify.com/projects/vitest-dev/deploys/690c636e0644b50008db6a6c
😎 Deploy Preview https://deploy-preview-8951--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.

@sheremet-va
Copy link
Member

Thank you!

@sheremet-va sheremet-va merged commit 997ca5a into vitest-dev:main Nov 6, 2025
12 of 14 checks passed
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