debian-mirror-gitlab/spec/frontend/mocks/node/jquery.js
2019-09-30 21:07:59 +05:30

13 lines
303 B
JavaScript

/* 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 = $;