susanahernandezd
6/17/2019 - 9:02 AM

Mock jquery functions

const jQuery = () => global.$.fn
global.$ = jest.fn(jQuery)

global.$.fn = {
  trigger: jest.fn(jQuery),
  addClass: jest.fn(jQuery),
  removeClass: jest.fn(jQuery),
  off: jest.fn(jQuery),
  on: jest.fn(jQuery)
}