Reputation: 25
Could you please tell how to mock this kind of import using jest ?
import * as some from 'some-package';
Upvotes: 0
Views: 234
Reputation: 962
You could try mocking like follows
jest.mock('some-package', () => ({
// mock your methods or anything you want here, if not required leave this as is
}))
or
jest.mock('some-package');
Dont forget to use jest.unmock('some-package');
i you have other usecases
Upvotes: 2