Skip to content

Commit 234e8b6

Browse files
test: update test descriptions for ordinal numbers and implemented a test for special ordinal numbers
1 parent f08ec15 commit 234e8b6

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
@@ -25,4 +25,16 @@ test("Should return `2nd` for 2", () => {
2525

2626
test("Should return `3rd` for 3", () => {
2727
expect(getOrdinalNumber(3)).toEqual("3rd");
28+
});
29+
// Case 4: identify the special ordinal numbers for 11, 12, 13
30+
// When the number is 11, 12, 13,
31+
// The function should return "11th, 12th, 13th"
32+
33+
test ("should return `11th, 12th, 13th` for special ordinal numbers ending on these", () => {
34+
expect(getOrdinalNumber(11)).toEqual("11th");
35+
expect(getOrdinalNumber(12)).toEqual("12th");
36+
expect(getOrdinalNumber(13)).toEqual("13th");
37+
expect(getOrdinalNumber(111)).toEqual("111th");
38+
expect(getOrdinalNumber(112)).toEqual("112th");
39+
expect(getOrdinalNumber(113)).toEqual("113th");
2840
});

0 commit comments

Comments
 (0)