Skip to content

Conversation

@michael-debs
Copy link
Contributor

@michael-debs michael-debs commented Nov 30, 2025

Description

This PR fixes a bug where placeholders failed to render in the terminal. Previously, processLog handled arguments individually before calling format. This change removes the .map call and passes the arguments directly to the format function.

Resolves #9030

Before the fix:
image

After the fix:
image

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 30, 2025

Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit f72b807
🔍 Latest deploy log https://app.netlify.com/projects/vitest-dev/deploys/693a2a438397ab00087951a1
😎 Deploy Preview https://deploy-preview-9131--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.

Copy link
Contributor

@hi-ogawa hi-ogawa left a comment

Choose a reason for hiding this comment

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

test/browser/fixtures/print-logs/test/logs.test.ts is failing. Can you also add new test there?

@michael-debs michael-debs marked this pull request as draft December 2, 2025 16:54
@michael-debs
Copy link
Contributor Author

michael-debs commented Dec 2, 2025

Hello @hi-ogawa,

I noticed that some tests require new lines when printing objects to the console, while others do not. Is this expected behavior?

Currently, printing objects yields different results in the browser versus Node. Browser objects have new lines, but Node objects do not. Shouldn't the output be consistent across environments?

image

If this discrepancy is normal, I can write a custom format function for the browser (or add an option to the existing one) to support new lines without breaking the core tests.

I am new to this repo, so any guidance is appreciated.

@sheremet-va
Copy link
Member

Currently, printing objects yields different results in the browser versus Node. Browser objects have new lines, but Node objects do not. Shouldn't the output be consistent across environments?

Why wouldn't it be normal? Browser prints objects and HTML elements differently. We don't want to see a huge object instead of an HTML. We use stringify in formatInput exactly for that reason

@michael-debs
Copy link
Contributor Author

yeah you're right, thanks for your response @sheremet-va

@michael-debs michael-debs marked this pull request as ready for review December 5, 2025 00:07
@michael-debs michael-debs requested a review from hi-ogawa December 5, 2025 00:07
Copy link
Contributor

@hi-ogawa hi-ogawa left a comment

Choose a reason for hiding this comment

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

Looks good! I tweaked some code to reduce the diff.

@hi-ogawa hi-ogawa merged commit 84a3062 into vitest-dev:main Dec 15, 2025
14 of 16 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.

Console logs from playwright don't format strings

3 participants