eb45cb8c99
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().
13 lines
376 B
JavaScript
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');
|
|
});
|
|
});
|
|
});
|