Skip to content

Commit eaaccca

Browse files
Grouped tests together
1 parent 01b8b9c commit eaaccca

File tree

1 file changed

+3
-20
lines changed

1 file changed

+3
-20
lines changed

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

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,41 +9,24 @@ test(`Should return 11 when given an ace card`, () => {
99
});
1010

1111
// Case 2: Face Cards (J, Q, K)
12-
test(`Should return 10 when given a Jack card`, () => {
12+
test(`Should return 10 when given a Jack, Queen or King card`, () => {
1313
expect(getCardValue("J♥")).toEqual(10);
14-
});
15-
16-
test(`Should return 10 when given a Queen card`, () => {
1714
expect(getCardValue("Q♦")).toEqual(10);
18-
});
19-
20-
test(`Should return 10 when given a King card`, () => {
2115
expect(getCardValue("K♣")).toEqual(10);
2216
});
2317

2418
// Case 3: Number Cards (2-10)
25-
test(`Should return 2 when given a 2 card`, () => {
19+
test(`Should return the value of number cards (2-10)`, () => {
2620
expect(getCardValue("2♠")).toEqual(2);
27-
});
28-
29-
test(`Should return 10 when given a 10 card`, () => {
21+
expect(getCardValue("5♥")).toEqual(5);
3022
expect(getCardValue("10♥")).toEqual(10);
3123
});
3224

3325
// Case 4: Invalid Cards
3426
test(`Should throw an error when given an invalid card`, () => {
3527
expect(() => getCardValue("♠J")).toThrow();
36-
});
37-
38-
test(`Should throw an error when given an invalid card`, () => {
3928
expect(() => getCardValue("invalid")).toThrow();
40-
});
41-
42-
test(`Should throw an error when given an invalid card`, () => {
4329
expect(() => getCardValue("12♠")).toThrow();
44-
});
45-
46-
test(`Should throw an error when given an invalid card`, () => {
4730
expect(() => getCardValue("1")).toThrow();
4831
});
4932

0 commit comments

Comments
 (0)