Merge branch 'fix-raven-jquery-dep' into 'master'

Use non-global jQuery reference within raven bundle

Closes #32662

See merge request !11581
This commit is contained in:
Phil Hughes 2017-05-25 07:12:36 +00:00
commit 7ea9c5ce9a
2 changed files with 2 additions and 19 deletions

View File

@ -1,4 +1,5 @@
import Raven from 'raven-js';
import $ from 'jquery';
const IGNORE_ERRORS = [
// Random plugins/extensions
@ -74,7 +75,7 @@ const RavenConfig = {
},
bindRavenErrors() {
window.$(document).on('ajaxError.raven', this.handleRavenErrors);
$(document).on('ajaxError.raven', this.handleRavenErrors);
},
handleRavenErrors(event, req, config, err) {

View File

@ -140,24 +140,6 @@ describe('RavenConfig', () => {
});
});
describe('bindRavenErrors', () => {
let $document;
let $;
beforeEach(() => {
$document = jasmine.createSpyObj('$document', ['on']);
$ = jasmine.createSpy('$').and.returnValue($document);
window.$ = $;
RavenConfig.bindRavenErrors();
});
it('should call .on', function () {
expect($document.on).toHaveBeenCalledWith('ajaxError.raven', RavenConfig.handleRavenErrors);
});
});
describe('handleRavenErrors', () => {
let event;
let req;