Skip to content

Commit 9af1dec

Browse files
added tests for additional getordinalnumber function
1 parent a59de40 commit 9af1dec

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

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

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,28 @@ const getOrdinalNumber = require("./get-ordinal-number");
1111
test("should return '1st' for 1", () => {
1212
expect(getOrdinalNumber(1)).toEqual("1st");
1313
});
14+
15+
test("should return '121st' for 121", () =>{
16+
expect(getOrdinalNumber(121)).toEqual("121st")
17+
})
18+
19+
test("should return '2nd' for 2", () => {
20+
expect(getOrdinalNumber(2)).toEqual("2nd");
21+
});
22+
23+
24+
test("should return '3rd' for 3", () => {
25+
expect(getOrdinalNumber(3)).toEqual("3rd");
26+
});
27+
28+
test("should return '5th' for 5", () => {
29+
expect(getOrdinalNumber(5)).toEqual("5th");
30+
});
31+
32+
test("should return '11th' for 11", () => {
33+
expect(getOrdinalNumber(11)).toEqual("11th");
34+
});
35+
36+
test("should return NaN for s", () => {
37+
expect(getOrdinalNumber("8")).toEqual(NaN);
38+
});

0 commit comments

Comments
 (0)