Need to filter properties from object diffs #7092
Replies: 2 comments 6 replies
-
Do you have reproduction? I've also seen oom crash when equality fails #7009 Then if this turns out to be not fixable, perhaps we can consider adding user-land workaround. |
Beta Was this translation helpful? Give feedback.
-
I think I have similar usecase. I'm testing a Vue application and I had a test that kept OOMing. I reduced the repro to this. The test prints HUGE diff because it traverses the whole reactivity graph where something simpler (such as I don't expect vitest to come out of the box with pretty printer that somehow knows how to print vue Refs but I'd like to teach it how to do it - some API similar to |
Beta Was this translation helpful? Give feedback.
-
Hi friends of vitest,
I'm working a lot on and with Langium and Vitest has been huge benefit there.
I just ran into a problem that I would like to compare two objects for equality like
A
andB
be a part of a rather large spider web of objects, und in case of a mismatch the creation of the diff visualization makes the test execution crash after some time of polluting the memory.I saw that you have a config/customization hook for sorting the properties of objects, but no opportunity for filtering them. Ignoring a few known properties being prone to causing problems would help me a lot.
vitest/packages/utils/src/diff/index.ts
Lines 186 to 190 in 4e60333
Ideally I would love if I could contribute a custom
plugin
to the list ofpretty-format
plugins:vitest/packages/utils/src/diff/index.ts
Lines 37 to 57 in 4e60333
Realizing that
getFormatOptions(...)
simply ignores my custom plugin contribution almost made me biting my table 😖vitest/packages/utils/src/diff/index.ts
Lines 180 to 191 in 4e60333
What do think about opening something in that corner?
Beta Was this translation helpful? Give feedback.
All reactions