From d94c2e72be7e63ec67517319e4a3752844e3aa1e Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 14 Sep 2022 20:20:15 +0200 Subject: [PATCH] Fix test to use Date --- tests/unit/bincount.spec.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/unit/bincount.spec.ts b/tests/unit/bincount.spec.ts index 7caf6797..322e49e7 100644 --- a/tests/unit/bincount.spec.ts +++ b/tests/unit/bincount.spec.ts @@ -1,6 +1,6 @@ import { binData } from '@/shared/charts/binCount'; -describe.only('binCount.ts', () => { +describe('binCount.ts', () => { it('Bins data as expected', () => { const testData = [1, 1, 2, 3, 5, 6, 8, 10]; const res = binData(testData, 3); @@ -37,10 +37,10 @@ describe.only('binCount.ts', () => { it('Bins data performant', () => { const randomSize = 20000; const randomData = Array.from({ length: randomSize }, () => Math.floor(Math.random() * 10)); - const startTime = performance.now(); + const startTime = Date.now(); const res = binData(randomData, 5); - const endTime = performance.now(); + const endTime = Date.now(); expect(endTime - startTime).toBeLessThan(20); expect(res.map((v) => v[1]).reduce((a, b) => a + b)).toEqual(randomData.length);