Skip to content

Commit

Permalink
chore: Resolve jest@26 TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
gu-stav committed Aug 30, 2022
1 parent eaa938e commit 269c9cb
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions packages/core/upload/server/services/__tests__/metrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

const metricsService = require('../metrics');

// TODO: the matcher exists in jest@28
const closeTo = (expected, precision = 2) => ({
asymmetricMatch: (actual) => Math.abs(expected - actual) < 10 ** -precision / 2,
});

describe('metrics', () => {
describe('computeMetrics', () => {
test.each([
Expand Down Expand Up @@ -95,9 +90,9 @@ describe('metrics', () => {
expect(results).toMatchObject({
assetNumber,
folderNumber,
averageDepth: closeTo(averageDepth, 3),
averageDepth: expect.closeTo(averageDepth, 3),
maxDepth,
averageDeviationDepth: closeTo(averageDeviationDepth, 3),
averageDeviationDepth: expect.closeTo(averageDeviationDepth, 3),
});
});
});
Expand Down

0 comments on commit 269c9cb

Please sign in to comment.