UNPKG

rollbar

Version:

Effortlessly track and debug errors in your JavaScript applications with Rollbar. This package includes advanced error tracking features and an intuitive interface to help you identify and fix issues more quickly.

54 lines (51 loc) 1.61 kB
/* globals expect */ /* globals describe */ /* globals it */ /* globals sinon */ import * as p from '../src/browser/predicates.js'; describe('checkIgnore', function () { it('should return false if is ajax and ignoring ajax errors is on', function () { var item = { level: 'critical', body: { message: { extra: { isAjax: true } } }, }; var settings = { reportLevel: 'debug', plugins: { jquery: { ignoreAjaxErrors: true } }, }; expect(p.checkIgnore(item, settings)).to.not.be.ok(); }); it('should return true if is ajax and ignoring ajax errors is off', function () { var item = { level: 'critical', body: { message: { extra: { isAjax: true } } }, }; var settings = { reportLevel: 'debug', plugins: { jquery: { ignoreAjaxErrors: false } }, }; expect(p.checkIgnore(item, settings)).to.be.ok(); }); it('should return true if is not ajax and ignoring ajax errors is on', function () { var item = { level: 'critical', body: { message: { extra: { isAjax: false } } }, }; var settings = { reportLevel: 'debug', plugins: { jquery: { ignoreAjaxErrors: true } }, }; expect(p.checkIgnore(item, settings)).to.be.ok(); }); it('should return true if no ajax extra key and ignoring ajax errors is on', function () { var item = { level: 'critical', body: { message: 'a message' }, }; var settings = { reportLevel: 'debug', plugins: { jquery: { ignoreAjaxErrors: true } }, }; expect(p.checkIgnore(item, settings)).to.be.ok(); }); });