Skip to content

Commit f290799

Browse files
committed
added tests for 0 and negative numbers in get-ordinal-number
1 parent 7b64029 commit f290799

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Sprint-3/2-practice-tdd/get-ordinal-number.test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,15 @@ test("should return '1000011th' for 1000011", () => {
5959
test("should return '1000002nd' for 1000002", () => {
6060
expect(getOrdinalNumber(1000002)).toEqual("1000002nd");
6161
});
62+
test("should return '0th' for 0", () => {
63+
expect(getOrdinalNumber(0)).toEqual("0th");
64+
});
65+
test("should return '-1st' for -1", () => {
66+
expect(getOrdinalNumber(-1)).toEqual("-1st");
67+
});
68+
test("should return '-2nd' for -2", () => {
69+
expect(getOrdinalNumber(-2)).toEqual("-2nd");
70+
});
71+
test("should return '-3rd' for -3", () => {
72+
expect(getOrdinalNumber(-3)).toEqual("-3rd");
73+
});

0 commit comments

Comments
 (0)