Use non-global jQuery reference within raven bundle
This commit is contained in:
parent
ec2130bea8
commit
710e35378a
2 changed files with 2 additions and 19 deletions
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue