@@ -7,7 +7,69 @@ const getOrdinalNumber = require("./get-ordinal-number");
77// Case 1: Identify the ordinal number for 1
88// When the number is 1,
99// Then the function should return "1st"
10-
1110test ( "should return '1st' for 1" , ( ) => {
1211 expect ( getOrdinalNumber ( 1 ) ) . toEqual ( "1st" ) ;
1312} ) ;
13+
14+ // Case 2: Identify the ordinal number for 2
15+ // When the number is 2,
16+ // Then the function should return "2nd"
17+ test ( 'should return "2nd" for input 2' , ( ) => {
18+ expect ( getOrdinalNumber ( 2 ) ) . toBe ( "2nd" ) ;
19+ } ) ;
20+
21+ // Case 3: Identify the ordinal number for 3
22+ // When the number is 3,
23+ // Then the function should return "3rd"
24+ test ( 'should return "3rd" for input 3' , ( ) => {
25+ expect ( getOrdinalNumber ( 3 ) ) . toBe ( "3rd" ) ;
26+ } ) ;
27+
28+ // Case 4: Handle special case for 11
29+ // When the number is 11,
30+ // Then the function should return "11th"
31+ test ( 'should return "11th" for input 11' , ( ) => {
32+ expect ( getOrdinalNumber ( 11 ) ) . toBe ( "11th" ) ;
33+ } ) ;
34+
35+ // Case 5: Handle special case for 12
36+ // When the number is 12,
37+ // Then the function should return "12th"
38+ test ( 'should return "12th" for input 12' , ( ) => {
39+ expect ( getOrdinalNumber ( 12 ) ) . toBe ( "12th" ) ;
40+ } ) ;
41+
42+ // Case 6: Handle special case for 13
43+ // When the number is 13,
44+ // Then the function should return "13th"
45+ test ( 'should return "13th" for input 13' , ( ) => {
46+ expect ( getOrdinalNumber ( 13 ) ) . toBe ( "13th" ) ;
47+ } ) ;
48+
49+ // Case 7: Identify the ordinal number for 21
50+ // When the number is 21,
51+ // Then the function should return "21st"
52+ test ( 'should return "21st" for input 21' , ( ) => {
53+ expect ( getOrdinalNumber ( 21 ) ) . toBe ( "21st" ) ;
54+ } ) ;
55+
56+ // Case 8: Identify the ordinal number for 102
57+ // When the number is 102,
58+ // Then the function should return "102nd"
59+ test ( 'should return "102nd" for input 102' , ( ) => {
60+ expect ( getOrdinalNumber ( 102 ) ) . toBe ( "102nd" ) ;
61+ } ) ;
62+
63+ // Case 9: Identify the ordinal number for 113
64+ // When the number is 113,
65+ // Then the function should return "113th"
66+ test ( 'should return "113th" for input 113' , ( ) => {
67+ expect ( getOrdinalNumber ( 113 ) ) . toBe ( "113th" ) ;
68+ } ) ;
69+
70+ // Case 10: Identify the ordinal number for 100
71+ // When the number is 100,
72+ // Then the function should return "100th"
73+ test ( 'should return "100th" for input 100' , ( ) => {
74+ expect ( getOrdinalNumber ( 100 ) ) . toBe ( "100th" ) ;
75+ } ) ;
0 commit comments