Skip to content

Conversation

@hi-ogawa
Copy link
Contributor

@hi-ogawa hi-ogawa commented Feb 13, 2025

Description

I chose default 20 for mostly arbitrary reason. We want this as large as possible to be able to print diff that only happens in a deeper level, but the default should be a safer side from crash.
This default value is likely still too big for worst cases, but at least, OP's repro get smooth with this https://stackblitz.com/edit/vitest-dev-vitest-cewwclhz?file=test%2Fsuite.test.js.

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 Feb 13, 2025

Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 221e023
🔍 Latest deploy log https://app.netlify.com/sites/vitest-dev/deploys/67ae8d721fc0ce00086d0a26
😎 Deploy Preview https://deploy-preview-7481--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.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 13, 2025

@vitest/browser

npm i https://pkg.pr.new/@vitest/browser@7481

@vitest/coverage-istanbul

npm i https://pkg.pr.new/@vitest/coverage-istanbul@7481

@vitest/expect

npm i https://pkg.pr.new/@vitest/expect@7481

@vitest/mocker

npm i https://pkg.pr.new/@vitest/mocker@7481

@vitest/pretty-format

npm i https://pkg.pr.new/@vitest/pretty-format@7481

@vitest/coverage-v8

npm i https://pkg.pr.new/@vitest/coverage-v8@7481

@vitest/runner

npm i https://pkg.pr.new/@vitest/runner@7481

@vitest/snapshot

npm i https://pkg.pr.new/@vitest/snapshot@7481

@vitest/spy

npm i https://pkg.pr.new/@vitest/spy@7481

@vitest/ui

npm i https://pkg.pr.new/@vitest/ui@7481

@vitest/utils

npm i https://pkg.pr.new/@vitest/utils@7481

vite-node

npm i https://pkg.pr.new/vite-node@7481

@vitest/web-worker

npm i https://pkg.pr.new/@vitest/web-worker@7481

vitest

npm i https://pkg.pr.new/vitest@7481

@vitest/ws-client

npm i https://pkg.pr.new/@vitest/ws-client@7481

commit: 221e023

@hi-ogawa hi-ogawa changed the title fix: add default maxDepth to avoid large diff fix: set default maxDepth to avoid large diff Feb 13, 2025
@hi-ogawa hi-ogawa changed the title fix: set default maxDepth to avoid large diff feat: add diff.maxDepth option Feb 13, 2025
@hi-ogawa hi-ogawa changed the title feat: add diff.maxDepth option feat: add diff.maxDepth option and set non-Infinity value as a default to reduce crash Feb 13, 2025
@hi-ogawa hi-ogawa marked this pull request as ready for review February 14, 2025 00:25
@sheremet-va sheremet-va added this to the 3.1.0 milestone Mar 3, 2025
@sheremet-va sheremet-va merged commit eacab25 into vitest-dev:main Mar 17, 2025
13 of 14 checks passed
@hi-ogawa hi-ogawa deleted the fix-diff-maxDepth branch March 17, 2025 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ability to customize how objects are printed in case of test failure

2 participants