this.addMatchers({ toBeAbout: function (expected, precision) { if (typeof this.actual !== 'number' || typeof expected !== 'number') { return false; } var delta = Math.abs(expected - this.actual); precision = precision || 20; return delta <= precision; }, toBeNumber: function () { return Object.prototype.toString.call(this.actual) === '[object Number]'; }, toBeHidden: function () { return this.actual.classList.contains('hidden'); }, toBeVisible: function () { return !this.actual.classList.contains('hidden'); }, toBeChecked: function () { var elem = CLND.dom.closest(this.actual, '[data-role="checkbox"]'); return this.actual.checked && elem.classList.contains('checkbox_checked'); }, toBeUnchecked: function () { var elem = CLND.dom.closest(this.actual, '[data-role="checkbox"]'); return !this.actual.checked && !elem.classList.contains('checkbox_checked'); } });