-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to customize the maximum truncated output #962
Comments
please do you provide a demo for 'long test snapshot' i need more context |
@cuixiaorui Here's an example where the color of the svg was import { it, expect } from 'vitest'
it('truncated', () => {
const input = '<svgwidth="2000"height="4000"xmlns="http://www.w3.org/2000/svg"><pathd="M1010"/><circlecx="10"cy="10"r="2"fill="red"/></svg>'
const output = '"<svgwidth=\\"2000\\"height=\\"4000\\"xmlns=\\"http://www.w3.org/2000/svg\\"><pathd=\\"M1010\\"/><circlecx=\\"10\\"cy=\\"10\\"r=\\"2\\"fill=\\"blue\\"/></svg>"'
expect(input).toMatchInlineSnapshot(output)
}) |
@styfle Let me check your demo and see if it's possible! |
Where do I look when output is still truncated even though I specify |
If you're using testing-library and diffing DOM output please note it has its own internal print limit:
https://testing-library.com/docs/dom-testing-library/api-debugging/#automatic-logging |
Clear and concise description of the problem
Currently Vitest uses
process.stdout.columns || 80
as the limit of diff output. It would be great to have a way to customize that size, especially when you have a really long test snapshot.Suggested solution
An
outputTruncateLength
option.Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: