Skip to content

Commit 694f1cf

Browse files
committed
jest test implemented for tricky invalid cards
1 parent 9d4539d commit 694f1cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function getCardValue(card) {
3535

3636
if (rank === "A"){
3737
return 11;
38-
}else if(rank.match(/J|Q|K/)){
38+
}else if(/^[JQK]$/.test(rank)){
3939
return 10;
4040
}else if(rank.match(/^(10|[2-9])$/)){
4141
return Number(rank);

0 commit comments

Comments
 (0)