Closed shamokit closed 2 months ago
Thanks for your report @shamokit, this is a really interesting bug. It's caused by a couple of "bugs", one in Svelte itself and one in Happy DOM
document.createTextNode
document.createTextNode
is not coerced into a string
node.data
into a stringI think the best path forward would probably be an issue filed with Happy DOM - I doubt Svelte v4 is getting any real attention at this point, and this bug appears fixed in v5. There's unfortunately nothing we can do about this issue in this library
@mcous Thank you for your reply!
I will wait for the release of Svelte5. Thank you very much for your time👍
@shamokit the latest version of happy-dom resolves the issue that seemed to be the cause. I think you should no longer see this error
@mcous I confirmed that it has been fixed. Thank you for contacting us!
@yanick we can close this one out, fixed upstream
Upstream fixes are the best fixes. :heart:
repository
https://github.com/shamokit/svelte-vitest-happydom-PrettyFormatPluginError
packages
about
When a test fails, "PrettyFormatPluginError" may appear instead of "TestingLibraryElementError" that should appear.
I would be happy if TestingLibraryElementError would be returned.
code
Buttons.svelte
Buttons.test.ts
changedButton does not exist. At this time, a "TestingLibraryElementError" error should be returned, but if there is an element that depends on another
export let
in the component, a "PrettyFormatPluginError" will be returned.example
or
→ TestingLibraryElementError(OK)
→ PrettyFormatPluginError(NG)