github-readme-stats/tests/calculateRank.test.js

19 lines
464 B
JavaScript
Raw Normal View History

import "@testing-library/jest-dom";
2022-09-24 20:10:06 +08:00
import { calculateRank } from "../src/calculateRank.js";
2020-07-13 22:11:47 +08:00
describe("Test calculateRank", () => {
it("should calculate rank correctly", () => {
expect(
calculateRank({
totalCommits: 100,
totalRepos: 5,
followers: 100,
contributions: 61,
stargazers: 400,
prs: 300,
issues: 200,
}),
).toStrictEqual({ level: "A+", score: 49.25629684876535 });
2020-07-13 22:11:47 +08:00
});
});