summaryrefslogtreecommitdiff
path: root/spec/frontend/mocks/node/jquery.js
blob: 34a25772f6755d7c04b937538943b1fe7b499977 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* eslint-disable import/no-commonjs */

const $ = jest.requireActual('jquery');

// Fail tests for unmocked requests
$.ajax = () => {
  throw new Error(
    'Unexpected unmocked jQuery.ajax() call! Make sure to mock jQuery.ajax() in tests.',
  );
};

// jquery is not an ES6 module
module.exports = $;