Open jarekcimoch opened 8 months ago
We expect the tests to be run in a DOM-like environment.
This also means that there's a MutationObserver
observer available to react to dom changes.
A workaround is to run all tests in a "fake timers context", which doesn't use the observer.
@timdeschryver HappyDom is DOM-like env, it has MutiationObserver in place
@jarekcimoch do you have a reproduction that I can use to test this?
https://github.com/capricorn86/happy-dom/issues/1514#issuecomment-2321982309
This error still occurs but there is a workaround in this linked issue.
It seems to be related to jest-preset-angular
patching the MutationObserver
.
Hello, I'm using HappyDom instead of JSDOM and I have following issue.
when I do something like
await screen.findByText(optionLabel);
observer.observe is not a function TypeError: observer.observe is not a function
at C:\Ohpen\cloned-2\mfes-broker-app-angular\src\node_modules\@testing-library\dom\dist\wait-for.js:96:16
HappyDom is supporting MutationObserver and I guess JSDOM was not out of the box hance some logic there is used. Could it be fixed? Or can I fix it somehow myself?