This problem is only fixable by changing the location of import and jest.Mock. It creates the problem, because when we import depA and bring it to our module’s runtime, it already read all the…