@@ -30,7 +30,7 @@ test("should return '10th' for 10", () => {
3030
3131test ( "should return '11th' for 11" , ( ) => {
3232 expect ( getOrdinalNumber ( 11 ) ) . toEqual ( "11th" ) ;
33- } )
33+ } ) ;
3434
3535test ( "should return '12th' for 12" , ( ) => {
3636 expect ( getOrdinalNumber ( 12 ) ) . toEqual ( "12th" ) ;
@@ -42,10 +42,50 @@ test("should return '13th' for 13", () => {
4242
4343test ( "should return '21st' for 21" , ( ) => {
4444 expect ( getOrdinalNumber ( 21 ) ) . toEqual ( "21st" ) ;
45- } )
45+ } ) ;
46+
47+ test ( "should return '23rd' for 23" , ( ) => {
48+ expect ( getOrdinalNumber ( 23 ) ) . toEqual ( "23rd" ) ;
49+ } ) ;
4650
51+ test ( "should return '22nd' for 22" , ( ) => {
52+ expect ( getOrdinalNumber ( 22 ) ) . toEqual ( "22nd" ) ;
53+ } ) ;
4754
55+ test ( "should return '100th' for 100" , ( ) => {
56+ expect ( getOrdinalNumber ( 100 ) ) . toEqual ( "100th" ) ;
57+ } ) ;
4858
4959test ( "should return '111th' for 111" , ( ) => {
5060 expect ( getOrdinalNumber ( 111 ) ) . toEqual ( "111th" ) ;
51- } ) ;
61+ } ) ;
62+
63+ test ( "should return '0th' for 0" , ( ) => {
64+ expect ( getOrdinalNumber ( 0 ) ) . toEqual ( "0th" ) ;
65+ } ) ;
66+
67+ test ( "should return '-111th' for -111" , ( ) => {
68+ expect ( getOrdinalNumber ( - 111 ) ) . toEqual ( "-111th" ) ;
69+ } ) ;
70+
71+ test ( "should return 'Invalid input: Input is an integer' for 1.52" , ( ) => {
72+ expect ( getOrdinalNumber ( 1.52 ) ) . toEqual ( "Invalid input: Input is an integer" ) ;
73+ } ) ;
74+
75+ test ( "should return 'Invalid input: Input is an integer' for null" , ( ) => {
76+ expect ( getOrdinalNumber ( null ) ) . toEqual ( "Invalid input: Input is an integer" ) ;
77+ } ) ;
78+
79+ test ( "should return 'Invalid input: Input is an integer' for undefined" , ( ) => {
80+ expect ( getOrdinalNumber ( undefined ) ) . toEqual (
81+ "Invalid input: Input is an integer"
82+ ) ;
83+ } ) ;
84+
85+ test ( "should return 'Invalid input: Input is an integer' for 'a'" , ( ) => {
86+ expect ( getOrdinalNumber ( "a" ) ) . toEqual ( "Invalid input: Input is an integer" ) ;
87+ } ) ;
88+
89+ test ( "should return 'Invalid input: Input is an integer' for {}" , ( ) => {
90+ expect ( getOrdinalNumber ( { } ) ) . toEqual ( "Invalid input: Input is an integer" ) ;
91+ } ) ;
0 commit comments