Open berkon opened 2 weeks ago
I'm facing the same problem, I think it has been introduced by keycloak-js v26 rather.
@ash-burns I was able to solve it with a workaround. You have to put this in your jest-setup.ts:
// @ts-ignore
window.MutationObserver = window[Zone.__symbol__("MutationObserver")];
The // @ts-ignore line is very important, otherwise the TS compiler will complain. I got the solution from this post:
https://github.com/capricorn86/happy-dom/issues/1514#issuecomment-2321982309
Bug Report or Feature Request (mark with an
x
)I'm trying to run jest with
keycloak-angular
. There are no test cases there yet. When runningnpm test
initially I got this error:SyntaxError: Cannot use import statement outside a module
after adding
keycloak-angular
to the regex of thetransformIgnorePatterns
property ofjest.config.ts
("adding" here in fact means removing it! Really strange logic!) the error turned into this:TypeError: e.observe is not a function
Versions.
keycloak-angular@16.0.1 keycloak-js@25.0.6 angular@18.2.8
Repro steps.
The log given by the failure.
Desired functionality.
Running jest should not fail because of e.observe