gitlab-org--gitlab-foss/spec/frontend/mocks_spec.js
Martin Hanzel eb45cb8c99 Mockify jquery and axios packages
Moved the block that fails tests on unmocked axios requests from
test_setup to its own mock, and added a jQuery mock that fails
tests if they use unmocked $.ajax().
2019-07-17 17:47:39 +00:00

13 lines
376 B
JavaScript

import $ from 'jquery';
import axios from '~/lib/utils/axios_utils';
describe('Mock auto-injection', () => {
describe('mocks', () => {
it('~/lib/utils/axios_utils', () =>
expect(axios.get('http://gitlab.com')).rejects.toThrow('Unexpected unmocked request'));
it('jQuery.ajax()', () => {
expect($.ajax).toThrow('Unexpected unmocked');
});
});
});