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

19 lines
463 B
JavaScript
Raw Normal View History

2020-07-13 22:11:47 +08:00
require("@testing-library/jest-dom");
const calculateRank = require("../src/calculateRank");
describe("Test calculateRank", () => {
it("should calculate rank correctly", () => {
expect(
calculateRank({
totalCommits: 100,
totalRepos: 5,
followers: 100,
contributions: 61,
stargazers: 400,
prs: 300,
issues: 200,
})
2020-07-14 16:38:57 +08:00
).toStrictEqual({ level: "A+", score: 49.16605417270399 });
2020-07-13 22:11:47 +08:00
});
});