Closed mcous closed 3 months ago
Thank you for reporting @mcous! :slightly_smiling_face:
Big thanks to @odanado for contributing with a fix :star:
You can read more about the release here: https://github.com/capricorn86/happy-dom/releases/tag/v14.6.1
Describe the bug
Hello! I'm filing this issue in response to an issue that got raised over at https://github.com/testing-library/svelte-testing-library/issues/343.
document.createTextNode(data)
is used to create text nodesdata
is expected to be a DOMStringcreateTextNode
, it will be coerced into a stringnode.data
ends up not a string, causing problems in downstream consumersTo Reproduce
In the case of the issue filed in
@testing-library/svelte
:svelte@4
erroneously passes a non-string tocreateTextNode
, and then the pretty printing library that is used to print test results chokes because it tries to do aString.replace
onnode.data
, which may not be a stringExpected behavior
I expect the resulting
data
property ofcreateTextNode
to always be a stringAdditional context
Tested with
happy-dom@14.4.0