diff --git a/test/spec/ol/expect.test.js b/test/spec/ol/expect.test.js index 78b866156f..349727992e 100644 --- a/test/spec/ol/expect.test.js +++ b/test/spec/ol/expect.test.js @@ -2,21 +2,6 @@ describe('expect.js', function() { - describe('arreqlNaN', function() { - - it('considers NaN in array to be equal', function() { - expect([1, NaN, 2]).to.arreqlNaN([1, NaN, 2]); - expect([1, NaN, 2]).not.to.arreqlNaN([1, 1.5, 2]); - }); - - it('allows a mix of number and string', function() { - expect([1, NaN, 'foo']).to.arreqlNaN([1, NaN, 'foo']); - expect([1, NaN, 'foo']).not.to.arreqlNaN([1, NaN, 'bar']); - expect([1, NaN]).not.to.arreqlNaN([1, 'foo']); - }); - - }); - describe('roughlyEqual', function() { it('can tell the difference between 1 and 3', function() { diff --git a/test/test-extensions.js b/test/test-extensions.js index eb8bd34634..5217f5cb06 100644 --- a/test/test-extensions.js +++ b/test/test-extensions.js @@ -1,4 +1,3 @@ -import {equals} from '../src/ol/array.js'; // avoid importing anything that results in an instanceof check // since these extensions are global, instanceof checks fail with modules @@ -292,50 +291,6 @@ import {equals} from '../src/ol/array.js'; }; - /** - * Checks if the array sort of equals another array. - * @param {Object} obj The other object. - * @return {expect.Assertion} The assertion. - */ - expect.Assertion.prototype.arreql = function(obj) { - this.assert( - equals(this.obj, obj), - function() { - return 'expected ' + expect.stringify(this.obj) + - ' to sort of equal ' + expect.stringify(obj); - }, - function() { - return 'expected ' + expect.stringify(this.obj) + - ' to sort of not equal ' + expect.stringify(obj); - }); - return this; - }; - - - /** - * Checks if the array sort of equals another array (allows NaNs to be equal). - * @param {Object} obj The other object. - * @return {expect.Assertion} The assertion. - */ - expect.Assertion.prototype.arreqlNaN = function(obj) { - function compare(a, i) { - const b = obj[i]; - return a === b || (typeof a === 'number' && typeof b === 'number' && - isNaN(a) && isNaN(b)); - } - this.assert( - this.obj.length === obj.length && this.obj.every(compare), - function() { - return 'expected ' + expect.stringify(this.obj) + - ' to sort of equal ' + expect.stringify(obj); - }, - function() { - return 'expected ' + expect.stringify(this.obj) + - ' to sort of not equal ' + expect.stringify(obj); - }); - return this; - }; - global.createMapDiv = function(width, height) { const target = document.createElement('div'); const style = target.style;