Skip to content

Commit d6f14a8

Browse files
committed
test is done with different Numbers
1 parent 745b6e9 commit d6f14a8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,13 @@ const getOrdinalNumber = require("./get-ordinal-number");
1111
test("should return '1st' for 1", () => {
1212
expect(getOrdinalNumber(1)).toEqual("1st");
1313
});
14+
test("should return 'th' for 11, 12, 13", () => {
15+
expect(getOrdinalNumber(11)).toBe("11th");
16+
expect(getOrdinalNumber(12)).toBe("12th");
17+
expect(getOrdinalNumber(13)).toBe("13th");
18+
});
19+
test("should return correct ordinal for numbers > 20", () => {
20+
expect(getOrdinalNumber(21)).toBe("21st");
21+
expect(getOrdinalNumber(22)).toBe("22nd");
22+
expect(getOrdinalNumber(23)).toBe("23rd");
23+
});

0 commit comments

Comments
 (0)