test: revert wrong change
[poolifier.git] / tests / utils.test.js
index eb0e7b1530a29a5195b21a292c6210856a47acb1..f3278e4780b064ee25b6fcf7d900559b96fb23c7 100644 (file)
@@ -3,10 +3,10 @@ const { isPlainObject, median } = require('../lib/utils')
 
 describe('Utils test suite', () => {
   it('Verify median computation', () => {
-    const array0 = [0.08]
-    expect(median(array0)).toBe(0.08)
-    const array1 = [0.25, 4.75, 3.05, 6.04, 1.01, 2.02, 5.03]
-    expect(median(array1)).toBe(3.05)
+    expect(median([])).toBe(0)
+    expect(median([0.08])).toBe(0.08)
+    expect(median([0.25, 4.75, 3.05, 6.04, 1.01, 2.02, 5.03])).toBe(3.05)
+    expect(median([0.25, 4.75, 3.05, 6.04, 1.01, 2.02])).toBe(2.535)
   })
 
   it('Verify isPlainObject() behavior', () => {