Skip to content

Commit 4997dd1

Browse files
committed
chore: running tests
1 parent f38fbfc commit 4997dd1

File tree

3 files changed

+211
-1
lines changed

3 files changed

+211
-1
lines changed

.github/workflows/unit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Install dependencies
2121
run: yarn install --frozen-lockfile
2222
- name: Test and coverage
23-
run: yarn jest --coverage
23+
run: yarn test:coverage
2424
- name: Sonar Args
2525
id: sonar-args
2626
run: |

junit.xml

Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<testsuites name="jest tests" tests="102" failures="0" errors="0" time="2.71">
3+
<testsuite name="GameUtils" errors="0" failures="0" skipped="0" timestamp="2024-01-29T22:33:13" time="2.455" tests="102">
4+
<testcase classname="GameUtils removeEmptyCards empty hand" name="GameUtils removeEmptyCards empty hand" time="0.001">
5+
</testcase>
6+
<testcase classname="GameUtils removeEmptyCards full hand" name="GameUtils removeEmptyCards full hand" time="0">
7+
</testcase>
8+
<testcase classname="GameUtils removeEmptyCards hand with empty card at end" name="GameUtils removeEmptyCards hand with empty card at end" time="0">
9+
</testcase>
10+
<testcase classname="GameUtils removeEmptyCards hand with empty card at beginning" name="GameUtils removeEmptyCards hand with empty card at beginning" time="0">
11+
</testcase>
12+
<testcase classname="GameUtils removeEmptyCards hand with empty card in middle" name="GameUtils removeEmptyCards hand with empty card in middle" time="0">
13+
</testcase>
14+
<testcase classname="GameUtils removeEmptyCards hand with multiple empty cards" name="GameUtils removeEmptyCards hand with multiple empty cards" time="0.001">
15+
</testcase>
16+
<testcase classname="GameUtils removeEmptyCards hand with multiple empty cards at beginning" name="GameUtils removeEmptyCards hand with multiple empty cards at beginning" time="0">
17+
</testcase>
18+
<testcase classname="GameUtils removeEmptyCards hand with multiple empty cards at end" name="GameUtils removeEmptyCards hand with multiple empty cards at end" time="0">
19+
</testcase>
20+
<testcase classname="GameUtils removeEmptyCards hand with multiple empty cards in middle" name="GameUtils removeEmptyCards hand with multiple empty cards in middle" time="0">
21+
</testcase>
22+
<testcase classname="GameUtils removeEmptyCards hand with only empty cards" name="GameUtils removeEmptyCards hand with only empty cards" time="0">
23+
</testcase>
24+
<testcase classname="GameUtils compareCards 2 empty hands should return true" name="GameUtils compareCards 2 empty hands should return true" time="0">
25+
</testcase>
26+
<testcase classname="GameUtils compareCards different length hands" name="GameUtils compareCards different length hands" time="0.001">
27+
</testcase>
28+
<testcase classname="GameUtils compareCards equal hands" name="GameUtils compareCards equal hands" time="0.006">
29+
</testcase>
30+
<testcase classname="GameUtils compareCards different hands" name="GameUtils compareCards different hands" time="0">
31+
</testcase>
32+
<testcase classname="GameUtils compareCards equal hands with different order" name="GameUtils compareCards equal hands with different order" time="0">
33+
</testcase>
34+
<testcase classname="GameUtils padMyHand empty hand" name="GameUtils padMyHand empty hand" time="0.001">
35+
</testcase>
36+
<testcase classname="GameUtils padMyHand full hand" name="GameUtils padMyHand full hand" time="0">
37+
</testcase>
38+
<testcase classname="GameUtils padMyHand partial hand" name="GameUtils padMyHand partial hand" time="0">
39+
</testcase>
40+
<testcase classname="GameUtils processOrderedCardsAfterGameUpdate same cards" name="GameUtils processOrderedCardsAfterGameUpdate same cards" time="0">
41+
</testcase>
42+
<testcase classname="GameUtils processOrderedCardsAfterGameUpdate same cards with different order" name="GameUtils processOrderedCardsAfterGameUpdate same cards with different order" time="0">
43+
</testcase>
44+
<testcase classname="GameUtils processOrderedCardsAfterGameUpdate First card removed" name="GameUtils processOrderedCardsAfterGameUpdate First card removed" time="0">
45+
</testcase>
46+
<testcase classname="GameUtils processOrderedCardsAfterGameUpdate Last card removed" name="GameUtils processOrderedCardsAfterGameUpdate Last card removed" time="0">
47+
</testcase>
48+
<testcase classname="GameUtils processOrderedCardsAfterGameUpdate Middle card removed" name="GameUtils processOrderedCardsAfterGameUpdate Middle card removed" time="0.001">
49+
</testcase>
50+
<testcase classname="GameUtils processOrderedCardsAfterGameUpdate any other configuration 1" name="GameUtils processOrderedCardsAfterGameUpdate any other configuration 1" time="0">
51+
</testcase>
52+
<testcase classname="GameUtils processOrderedCardsAfterGameUpdate any other configuration 2" name="GameUtils processOrderedCardsAfterGameUpdate any other configuration 2" time="0">
53+
</testcase>
54+
<testcase classname="GameUtils areAllTrumpCards empty hand" name="GameUtils areAllTrumpCards empty hand" time="0">
55+
</testcase>
56+
<testcase classname="GameUtils areAllTrumpCards all trump cards" name="GameUtils areAllTrumpCards all trump cards" time="0">
57+
</testcase>
58+
<testcase classname="GameUtils areAllTrumpCards not all trump cards" name="GameUtils areAllTrumpCards not all trump cards" time="0">
59+
</testcase>
60+
<testcase classname="GameUtils containsATrumpCard empty hand" name="GameUtils containsATrumpCard empty hand" time="0">
61+
</testcase>
62+
<testcase classname="GameUtils containsATrumpCard has a trump card" name="GameUtils containsATrumpCard has a trump card" time="0.001">
63+
</testcase>
64+
<testcase classname="GameUtils containsATrumpCard doesn&apos;t have a trump card" name="GameUtils containsATrumpCard doesn&apos;t have a trump card" time="0">
65+
</testcase>
66+
<testcase classname="GameUtils removeCard empty hand" name="GameUtils removeCard empty hand" time="0">
67+
</testcase>
68+
<testcase classname="GameUtils removeCard remove first card" name="GameUtils removeCard remove first card" time="0">
69+
</testcase>
70+
<testcase classname="GameUtils removeCard remove last card" name="GameUtils removeCard remove last card" time="0">
71+
</testcase>
72+
<testcase classname="GameUtils removeCard remove middle card" name="GameUtils removeCard remove middle card" time="0">
73+
</testcase>
74+
<testcase classname="GameUtils removeAllFromHand empty hand" name="GameUtils removeAllFromHand empty hand" time="0">
75+
</testcase>
76+
<testcase classname="GameUtils removeAllFromHand remove first card" name="GameUtils removeAllFromHand remove first card" time="0">
77+
</testcase>
78+
<testcase classname="GameUtils removeAllFromHand remove last card" name="GameUtils removeAllFromHand remove last card" time="0">
79+
</testcase>
80+
<testcase classname="GameUtils removeAllFromHand remove middle card" name="GameUtils removeAllFromHand remove middle card" time="0">
81+
</testcase>
82+
<testcase classname="GameUtils removeAllFromHand remove multiple cards" name="GameUtils removeAllFromHand remove multiple cards" time="0.001">
83+
</testcase>
84+
<testcase classname="GameUtils removeAllFromHand remove multiple cards in different order" name="GameUtils removeAllFromHand remove multiple cards in different order" time="0">
85+
</testcase>
86+
<testcase classname="GameUtils removeAllFromHand remove all cards" name="GameUtils removeAllFromHand remove all cards" time="0">
87+
</testcase>
88+
<testcase classname="GameUtils riskOfMistakeBuyingCards none selected" name="GameUtils riskOfMistakeBuyingCards none selected" time="0">
89+
</testcase>
90+
<testcase classname="GameUtils riskOfMistakeBuyingCards no trump cards" name="GameUtils riskOfMistakeBuyingCards no trump cards" time="0">
91+
</testcase>
92+
<testcase classname="GameUtils riskOfMistakeBuyingCards select all cards" name="GameUtils riskOfMistakeBuyingCards select all cards" time="0">
93+
</testcase>
94+
<testcase classname="GameUtils riskOfMistakeBuyingCards select all trumps" name="GameUtils riskOfMistakeBuyingCards select all trumps" time="0">
95+
</testcase>
96+
<testcase classname="GameUtils riskOfMistakeBuyingCards don&apos;t select all trumps" name="GameUtils riskOfMistakeBuyingCards don&apos;t select all trumps" time="0">
97+
</testcase>
98+
<testcase classname="GameUtils getTrumpCards empty hand" name="GameUtils getTrumpCards empty hand" time="0">
99+
</testcase>
100+
<testcase classname="GameUtils getTrumpCards all trump cards" name="GameUtils getTrumpCards all trump cards" time="0">
101+
</testcase>
102+
<testcase classname="GameUtils getTrumpCards no trump cards" name="GameUtils getTrumpCards no trump cards" time="0.003">
103+
</testcase>
104+
<testcase classname="GameUtils getTrumpCards all trump cards with joker and ace of hearts" name="GameUtils getTrumpCards all trump cards with joker and ace of hearts" time="0">
105+
</testcase>
106+
<testcase classname="GameUtils getTrumpCards some trump cards" name="GameUtils getTrumpCards some trump cards" time="0">
107+
</testcase>
108+
<testcase classname="GameUtils getColdCards empty hand" name="GameUtils getColdCards empty hand" time="0">
109+
</testcase>
110+
<testcase classname="GameUtils getColdCards all cold cards" name="GameUtils getColdCards all cold cards" time="0">
111+
</testcase>
112+
<testcase classname="GameUtils getColdCards no cold cards" name="GameUtils getColdCards no cold cards" time="0">
113+
</testcase>
114+
<testcase classname="GameUtils getColdCards all cold cards with joker and ace of hearts" name="GameUtils getColdCards all cold cards with joker and ace of hearts" time="0.001">
115+
</testcase>
116+
<testcase classname="GameUtils getColdCards some cold cards" name="GameUtils getColdCards some cold cards" time="0">
117+
</testcase>
118+
<testcase classname="GameUtils bestCardLead no suit" name="GameUtils bestCardLead no suit" time="0">
119+
</testcase>
120+
<testcase classname="GameUtils bestCardLead best card lead" name="GameUtils bestCardLead best card lead" time="0">
121+
</testcase>
122+
<testcase classname="GameUtils bestCardLead best card not lead" name="GameUtils bestCardLead best card not lead" time="0">
123+
</testcase>
124+
<testcase classname="GameUtils getBestCard empty hand" name="GameUtils getBestCard empty hand" time="0.024">
125+
</testcase>
126+
<testcase classname="GameUtils getBestCard trump card" name="GameUtils getBestCard trump card" time="0">
127+
</testcase>
128+
<testcase classname="GameUtils getBestCard follow cold card" name="GameUtils getBestCard follow cold card" time="0">
129+
</testcase>
130+
<testcase classname="GameUtils getBestCard only one card left" name="GameUtils getBestCard only one card left" time="0">
131+
</testcase>
132+
<testcase classname="GameUtils canRenege not a trump card" name="GameUtils canRenege not a trump card" time="0">
133+
</testcase>
134+
<testcase classname="GameUtils canRenege not a trump card" name="GameUtils canRenege not a trump card" time="0">
135+
</testcase>
136+
<testcase classname="GameUtils canRenege not a renegable card" name="GameUtils canRenege not a renegable card" time="0">
137+
</testcase>
138+
<testcase classname="GameUtils canRenege renegable card" name="GameUtils canRenege renegable card" time="0">
139+
</testcase>
140+
<testcase classname="GameUtils canRenege renegable card" name="GameUtils canRenege renegable card" time="0">
141+
</testcase>
142+
<testcase classname="GameUtils canRenege renegable card" name="GameUtils canRenege renegable card" time="0">
143+
</testcase>
144+
<testcase classname="GameUtils canRenege renegable card" name="GameUtils canRenege renegable card" time="0">
145+
</testcase>
146+
<testcase classname="GameUtils canRenege renegable card lower than card lead out" name="GameUtils canRenege renegable card lower than card lead out" time="0.001">
147+
</testcase>
148+
<testcase classname="GameUtils canRenege renegable card lower than card lead out" name="GameUtils canRenege renegable card lower than card lead out" time="0">
149+
</testcase>
150+
<testcase classname="GameUtils canRenege renegable card lower than card lead out" name="GameUtils canRenege renegable card lower than card lead out" time="0">
151+
</testcase>
152+
<testcase classname="GameUtils canRenege renegable card lower than card lead out" name="GameUtils canRenege renegable card lower than card lead out" time="0">
153+
</testcase>
154+
<testcase classname="GameUtils canRenege renegable card lower than card lead out" name="GameUtils canRenege renegable card lower than card lead out" time="0">
155+
</testcase>
156+
<testcase classname="GameUtils canRenege renegable card lower than card lead out" name="GameUtils canRenege renegable card lower than card lead out" time="0">
157+
</testcase>
158+
<testcase classname="GameUtils getWorstCard empty hand" name="GameUtils getWorstCard empty hand" time="0">
159+
</testcase>
160+
<testcase classname="GameUtils getWorstCard no card lead - cold card" name="GameUtils getWorstCard no card lead - cold card" time="0">
161+
</testcase>
162+
<testcase classname="GameUtils getWorstCard no card lead - trump card" name="GameUtils getWorstCard no card lead - trump card" time="0">
163+
</testcase>
164+
<testcase classname="GameUtils getWorstCard trump card lead - follow trump" name="GameUtils getWorstCard trump card lead - follow trump" time="0">
165+
</testcase>
166+
<testcase classname="GameUtils getWorstCard trump card lead - follow cold" name="GameUtils getWorstCard trump card lead - follow cold" time="0">
167+
</testcase>
168+
<testcase classname="GameUtils getWorstCard follow cold card" name="GameUtils getWorstCard follow cold card" time="0.001">
169+
</testcase>
170+
<testcase classname="GameUtils getWorstCard wild cards lead" name="GameUtils getWorstCard wild cards lead" time="0">
171+
</testcase>
172+
<testcase classname="GameUtils getWorstCard Can reneg five" name="GameUtils getWorstCard Can reneg five" time="0">
173+
</testcase>
174+
<testcase classname="GameUtils getWorstCard Can reneg - but it&apos;s the only card left" name="GameUtils getWorstCard Can reneg - but it&apos;s the only card left" time="0">
175+
</testcase>
176+
<testcase classname="GameUtils calculateMinCardsToKeep less than 2 players. Should throw an error" name="GameUtils calculateMinCardsToKeep less than 2 players. Should throw an error" time="0">
177+
</testcase>
178+
<testcase classname="GameUtils calculateMinCardsToKeep more than 6 players. Should throw an error" name="GameUtils calculateMinCardsToKeep more than 6 players. Should throw an error" time="0">
179+
</testcase>
180+
<testcase classname="GameUtils calculateMinCardsToKeep 2 players" name="GameUtils calculateMinCardsToKeep 2 players" time="0">
181+
</testcase>
182+
<testcase classname="GameUtils calculateMinCardsToKeep 3 players" name="GameUtils calculateMinCardsToKeep 3 players" time="0">
183+
</testcase>
184+
<testcase classname="GameUtils calculateMinCardsToKeep 4 players" name="GameUtils calculateMinCardsToKeep 4 players" time="0">
185+
</testcase>
186+
<testcase classname="GameUtils calculateMinCardsToKeep 5 players" name="GameUtils calculateMinCardsToKeep 5 players" time="0">
187+
</testcase>
188+
<testcase classname="GameUtils calculateMinCardsToKeep 6 players" name="GameUtils calculateMinCardsToKeep 6 players" time="0">
189+
</testcase>
190+
<testcase classname="GameUtils pickBestCards empty hand" name="GameUtils pickBestCards empty hand" time="0">
191+
</testcase>
192+
<testcase classname="GameUtils pickBestCards all trumps" name="GameUtils pickBestCards all trumps" time="0">
193+
</testcase>
194+
<testcase classname="GameUtils pickBestCards Must keep 2" name="GameUtils pickBestCards Must keep 2" time="0.001">
195+
</testcase>
196+
<testcase classname="GameUtils pickBestCards Must keep 1" name="GameUtils pickBestCards Must keep 1" time="0">
197+
</testcase>
198+
<testcase classname="GameUtils pickBestCards Must keep 0" name="GameUtils pickBestCards Must keep 0" time="0">
199+
</testcase>
200+
<testcase classname="GameUtils pickBestCards Must keep 0" name="GameUtils pickBestCards Must keep 0" time="0">
201+
</testcase>
202+
<testcase classname="GameUtils pickBestCards Must keep 0" name="GameUtils pickBestCards Must keep 0" time="0">
203+
</testcase>
204+
<testcase classname="GameUtils pickBestCards Wild cards one" name="GameUtils pickBestCards Wild cards one" time="0">
205+
</testcase>
206+
<testcase classname="GameUtils pickBestCards Wild cards 2" name="GameUtils pickBestCards Wild cards 2" time="0">
207+
</testcase>
208+
</testsuite>
209+
</testsuites>

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
"start": "react-scripts start",
7676
"build": "react-scripts build",
7777
"test": "react-scripts test --env=jsdom",
78+
"test:coverage": "react-scripts test --env=jsdom --coverage --watchAll=false",
7879
"eject": "react-scripts eject",
7980
"format": "yarn prettier --write src",
8081
"format:check": "yarn prettier --check src"

0 commit comments

Comments
 (0)