We are using version 2.1.56 along with Angular 13.2 and Jest 27. All angular-dependent packages are up to date and working fine.
I tried to update gojs also to the latest version (2.2.3) and lots of unit tests began to fail due to the useDOM function and other functions too. We have a beforeAll hook making lots of unit test to fail
beforeAll(() => go.Diagram.useDOM(false));
Errors are like these:
TypeError: go.Diagram.useDOM is not a function
...
TypeError: a.getContext is not a function
> 6 | $(go.Diagram, {
| ^
7 | model: $(go.GraphLinksModel),
8 | });
Why v2.1 is compatible with Angular 13 and v2.2 is failing while testing with jest 27? Anyone with the same issue?
So for some reason the GoJS library isn’t being loaded? I cannot explain that.
There is a bug involving the Shadow DOM that we introduced in 2.2.0 and have fixed in 2.2.4, which hasn’t been released yet but is in beta at: GoJS Beta. Try using https://gojs.net/beta/release/go.js or go-module.js to see if things work for you. If so, we’ll release it very soon.
Sorry about this. Diagram static functions isUsingDOM and useDOM were failing minification. This has been fixed and will be out with the next release, probably some time today, once we test for similar issues.