I\'m trying to mock a call to a service but I\'m struggeling with the following message: The module factory of jest.mock() is not allowed to reference a
jest.mock()
If you are getting similar error when upgrading to newer Jest [19 to 21 in my case], you can try changing jest.mock to jest.doMock.
jest.mock
jest.doMock
Found this here – https://github.com/facebook/jest/commit/6a8c7fb874790ded06f4790fdb33d8416a7284c8