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 $ 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) {
......
......@@ -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;
......
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