Skip to content

Conversation

@vardhan30016
Copy link

Summary

This PR fixes a failing test in tests/calculateRank.test.js caused by a minor floating-point precision mismatch in the expected percentile value for the "B-" rank.

Details

  • Replaced toStrictEqual() with toBeCloseTo() for the percentile comparison in the "beginner user gets B- rank" test.
  • This allows small floating-point differences (up to 5 decimal places) without failing the test suite.
  • No changes were made to the calculateRank() implementation itself — only to the test expectation.

Motivation

Floating-point calculations may differ slightly across environments and Node.js versions.
Using toBeCloseTo() ensures test reliability without compromising accuracy.

Verification

✅ All tests pass locally with:

npm test

@vercel
Copy link

vercel bot commented Nov 4, 2025

@vardhan30016 is attempting to deploy a commit to the github readme stats Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added the dependencies Pull requests that update a dependency file label Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant