I have a custom Experience Builder widget which itself works fine, but im having trouble writing a unit test for it. The widget creates a GraphicsLayer in the constructor and the import for it looks like
import { GraphicsLayer } from "esri/layers/GraphicsLayer";
When it comes to the unit test, it fails with the error
TypeError: GraphicsLayer_1.GraphicsLaye is not a constructor
If i change the import to
import GraphicsLayer from "esri/layers/GraphicsLayer";
the error changes to
TypeError: GraphicsLayer_1.default is not a constructor
What am I missing, i tried adding a mock like
jest.mock("esri/layers/GraphicsLayer");
But that didnt help.
Thanks