@@ -20,7 +20,7 @@ test("should append 'st' for numbers ending with 1, except those ending with 11"
2020} ) ;
2121
2222// Case 2: Numbers ending in 2 → add nd → (2nd, 22nd, 42nd)
23- test ( "should append 'nd' for numbers ending with 2" , ( ) => {
23+ test ( "should append 'nd' for numbers ending with 2, except those ending with 12 " , ( ) => {
2424 expect ( getOrdinalNumber ( 2 ) ) . toEqual ( "2nd" ) ;
2525 expect ( getOrdinalNumber ( 22 ) ) . toEqual ( "22nd" ) ;
2626 expect ( getOrdinalNumber ( 142 ) ) . toEqual ( "142nd" ) ;
@@ -32,13 +32,13 @@ test("should append '3rd' for numbers ending with 3", () => {
3232 expect ( getOrdinalNumber ( 153 ) ) . toEqual ( "153rd" ) ;
3333} ) ;
3434// Case 4: All other numbers → add th → (4th, 6th, 20th, 100th)
35- test ( "should append 'th' for numbers ending with 4,5,6,7,8,9 and 0" , ( ) => {
35+ test ( "should append 'th' for numbers ending with 4,5,6,7,8,9 or 0" , ( ) => {
3636 expect ( getOrdinalNumber ( 4 ) ) . toEqual ( "4th" ) ;
3737 expect ( getOrdinalNumber ( 20 ) ) . toEqual ( "20th" ) ;
3838 expect ( getOrdinalNumber ( 100 ) ) . toEqual ( "100th" ) ;
3939} ) ;
4040// Exceptions: Numbers ending in 11, 12, and 13 use -th (e.g., 11th, 12th, 13th).
41- test ( "should append 'th' for numbers ending with 11, 12 and 13" , ( ) => {
41+ test ( "should append 'th' for numbers ending with 11, 12 or 13" , ( ) => {
4242 expect ( getOrdinalNumber ( 11 ) ) . toEqual ( "11th" ) ;
4343 expect ( getOrdinalNumber ( 12 ) ) . toEqual ( "12th" ) ;
4444 expect ( getOrdinalNumber ( 113 ) ) . toEqual ( "113th" ) ;
0 commit comments