@@ -33,16 +33,20 @@ test("should append 'rd' for number anding with 3 expect those ending with 13",
3333 expect ( getOrdinalNumber ( 43 ) ) . toEqual ( "43rd" ) ;
3434} ) ;
3535
36- // Case 4: Number ending with 4 (but not 14)
37- test ( "should append 'th' for number ending with 4 expcet those ending with 14 " , ( ) => {
38- expect ( getOrdinalNumber ( 4 ) ) . toEqual ( "4th " ) ;
39- expect ( getOrdinalNumber ( 44 ) ) . toEqual ( "44th " ) ;
40- expect ( getOrdinalNumber ( 54 ) ) . toEqual ( "54th " ) ;
36+ // Case 4: Number ending with 11,12, 13
37+ test ( "should append 'th' for number ending with 11, 12, 13 " , ( ) => {
38+ expect ( getOrdinalNumber ( 11 ) ) . toEqual ( "11th " ) ;
39+ expect ( getOrdinalNumber ( 12 ) ) . toEqual ( "12th " ) ;
40+ expect ( getOrdinalNumber ( 13 ) ) . toEqual ( "13th " ) ;
4141} ) ;
4242
43- // Case 5: Number ending with 5 (but not 15)
44- test ( "should append 'th' for number ending with 5 except those ending with 15" , ( ) => {
43+ // Case 5: Numbers ending with 0, 4, 5, 6, 7, 8, or 9 (but not those ending with 11, 12, or 13)
44+ test ( "should append 'th' for number ending with 0, 4, 5, 6, 7, 8, or 9 ,(but not those ending with 11, 12, or 13)" , ( ) => {
45+ expect ( getOrdinalNumber ( 4 ) ) . toEqual ( "4th" ) ;
4546 expect ( getOrdinalNumber ( 5 ) ) . toEqual ( "5th" ) ;
46- expect ( getOrdinalNumber ( 55 ) ) . toEqual ( "55th" ) ;
47- expect ( getOrdinalNumber ( 65 ) ) . toEqual ( "65th" ) ;
47+ expect ( getOrdinalNumber ( 6 ) ) . toEqual ( "6th" ) ;
48+ expect ( getOrdinalNumber ( 7 ) ) . toEqual ( "7th" ) ;
49+ expect ( getOrdinalNumber ( 8 ) ) . toEqual ( "8th" ) ;
50+ expect ( getOrdinalNumber ( 9 ) ) . toEqual ( "9th" ) ;
51+ expect ( getOrdinalNumber ( 10 ) ) . toEqual ( "10th" ) ;
4852} ) ;
0 commit comments