Skip to content

Commit e9f9578

Browse files
committed
Fixed the mistakes and applied the special case
1 parent 9ffb265 commit e9f9578

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

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

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,20 @@ test("should append 'rd' for number anding with 3 expect those ending with 13",
3333
expect(getOrdinalNumber(43)).toEqual("43rd");
3434
});
3535

36-
// Case 4: Number ending with 4 (but not 14)
37-
test("should append 'th' for number ending with 4 expcet those ending with 14", () => {
38-
expect(getOrdinalNumber(4)).toEqual("4th");
39-
expect(getOrdinalNumber(44)).toEqual("44th");
40-
expect(getOrdinalNumber(54)).toEqual("54th");
36+
// Case 4: Number ending with 11,12, 13
37+
test("should append 'th' for number ending with 11, 12, 13", () => {
38+
expect(getOrdinalNumber(11)).toEqual("11th");
39+
expect(getOrdinalNumber(12)).toEqual("12th");
40+
expect(getOrdinalNumber(13)).toEqual("13th");
4141
});
4242

43-
// Case 5: Number ending with 5 (but not 15)
44-
test("should append 'th' for number ending with 5 except those ending with 15", () => {
43+
// Case 5: Numbers ending with 0, 4, 5, 6, 7, 8, or 9 (but not those ending with 11, 12, or 13)
44+
test("should append 'th' for number ending with 0, 4, 5, 6, 7, 8, or 9 ,(but not those ending with 11, 12, or 13)", () => {
45+
expect(getOrdinalNumber(4)).toEqual("4th");
4546
expect(getOrdinalNumber(5)).toEqual("5th");
46-
expect(getOrdinalNumber(55)).toEqual("55th");
47-
expect(getOrdinalNumber(65)).toEqual("65th");
47+
expect(getOrdinalNumber(6)).toEqual("6th");
48+
expect(getOrdinalNumber(7)).toEqual("7th");
49+
expect(getOrdinalNumber(8)).toEqual("8th");
50+
expect(getOrdinalNumber(9)).toEqual("9th");
51+
expect(getOrdinalNumber(10)).toEqual("10th");
4852
});

0 commit comments

Comments
 (0)