Commit 710e3537 authored by Luke "Jared" Bennett's avatar Luke "Jared" Bennett Committed by Phil Hughes

Use non-global jQuery reference within raven bundle

parent ec2130be
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