Skip to content

Commit 2c42fe7

Browse files
committed
improve readability and maintain consistency
1 parent 743daf6 commit 2c42fe7

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ test("should return false for an improper fraction, including negatives", () =>
1414
expect(isProperFraction(5, 4)).toEqual(false); // numerator greater than denominator
1515
expect(isProperFraction(5, -4)).toEqual(false); // negative denominator
1616
expect(isProperFraction(-5, 4)).toEqual(false); // negative numerator
17-
expect(isProperFraction(-5, -4)).toEqual(false); // both negative
17+
expect(isProperFraction(-5, -4)).toEqual(false); // both negative
1818
});
1919

2020
// Case 3: Identify Negative Fractions:

Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/3-get-card-value.test.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ test("should return 11 for all Aces", () => {
1111

1212
// Case 2: Handle Number Cards (2-10):
1313
test("should return correct value for number cards (2-10)", () => {
14-
const suits = ["♠", "♥", "♦", "♣"];
15-
for (let i = 2; i <= 10; i++) {
16-
for (const suit of suits) {
17-
expect(getCardValue(`${i}${suit}`)).toEqual(i);
18-
}
19-
}
20-
}); // Loop through numbers 2-10 for all suits; 36 test cases
14+
const suits = ["♠", "♥", "♦", "♣"];
15+
for (let i = 2; i <= 10; i++) {
16+
for (const suit of suits) {
17+
expect(getCardValue(`${i}${suit}`)).toEqual(i);
18+
}
19+
}
20+
}); // Loop through numbers 2-10 for all suits; 36 test cases
2121

2222
// Case 3: Handle Face Cards (J, Q, K):
2323
test("should return 10 for all face cards (J, Q, K)", () => {
@@ -30,11 +30,10 @@ test("should return 10 for all face cards (J, Q, K)", () => {
3030
}
3131
}); // Loop through face cards for all suits; 12 test cases
3232

33-
3433
// Case 4: Handle Invalid Cards:
3534
test("should throw error for all invalid cards", () => {
3635
const invalidCards = ["1♣", "11♦", "B♠", "Z♥", "15♣", "", " "];
3736
for (const card of invalidCards) {
3837
expect(() => getCardValue(card)).toThrow("Invalid card rank");
3938
}
40-
}); // Loop through all invalid cards; 7 test cases
39+
}); // Loop through all invalid cards; 7 test cases

0 commit comments

Comments
 (0)