Skip to content

Commit

Permalink
handed edge case of impossible score
Browse files Browse the repository at this point in the history
  • Loading branch information
Bullrich committed Jan 29, 2024
1 parent 06dd3aa commit 2dadd1f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/test/runner/validation/fellows.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,14 @@ describe("'Fellows' rule validation", () => {
expect(error.currentScore).toBeLessThan(5);
});

test("should throw when score is impossible", async () => {
fellowsApi.listFellows.mockResolvedValue([[users[2], 4]]);

await expect(runner.validatePullRequest(generateSchemaWithScore(10))).rejects.toThrow(
"Minimum score of 10 is higher that the obtainable score of 4!",
);
});

test("should allow a combination of scores", async () => {
fellowsApi.listFellows.mockResolvedValue([
[users[0], 4],
Expand Down

0 comments on commit 2dadd1f

Please sign in to comment.