babel-plugin-module-resolver
babel-plugin-module-resolver copied to clipboard
Jest mocks not having an effect
Hey all
Currently trying to get jest mocks working together with this plugin. I have tried different variations of jest.mock.
Here is my test:
// @flow
import mainframeClient from 'phon/mainframeClient'
jest.mock('phon/mainframeClient')
//jest.mock(require.resolve('phon/mainframeClient'))
describe('mainframe', () => {
it('test', () => {
// Not a mock
console.log(mainframeClient)
// This creates a mock correctly
console.log(jest.genMockFromModule('phon/mainframeClient'))
})
})
Hi @henrikbjorn ...I am also struggling with this problem. Did you find a solution in the end?