Commit 7ea9c5ce authored by Phil Hughes's avatar Phil Hughes

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

Use non-global jQuery reference within raven bundle

Closes #32662

See merge request !11581
parents ec2130be 710e3537
import Raven from 'raven-js'; import Raven from 'raven-js';
import $ from 'jquery';
const IGNORE_ERRORS = [ const IGNORE_ERRORS = [
// Random plugins/extensions // Random plugins/extensions
...@@ -74,7 +75,7 @@ const RavenConfig = { ...@@ -74,7 +75,7 @@ const RavenConfig = {
}, },
bindRavenErrors() { bindRavenErrors() {
window.$(document).on('ajaxError.raven', this.handleRavenErrors); $(document).on('ajaxError.raven', this.handleRavenErrors);
}, },
handleRavenErrors(event, req, config, err) { handleRavenErrors(event, req, config, err) {
......
...@@ -140,24 +140,6 @@ describe('RavenConfig', () => { ...@@ -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', () => { describe('handleRavenErrors', () => {
let event; let event;
let req; let req;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment