Skip to content

Commit ec34176

Browse files
update the hsb_test implementation
1 parent 0b094c8 commit ec34176

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

test/unit/color/hsb.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,12 @@
1515

1616
import HSBSpace from '../../../src/color/color_spaces/hsb.js';
1717

18-
// Helper function to compare arrays with tolerance
19-
const arrayApproximately = (arr1, arr2, delta = 0.01) => {
20-
if (arr1.length !== arr2.length) return false;
21-
for (let i = 0; i < arr1.length; i++) {
22-
if (Math.abs(arr1[i] - arr2[i]) > delta) return false;
18+
assert.arrayApproximately = function (arr1, arr2, delta, desc) {
19+
assert.equal(arr1.length, arr2.length);
20+
for (var i = 0; i < arr1.length; i++) {
21+
assert.approximately(arr1[i], arr2[i], delta, desc);
2322
}
24-
return true;
25-
};
23+
}
2624

2725
suite('color/HSB Color Space', function() {
2826
const accuracy = 0.01;

0 commit comments

Comments
 (0)