Skip to content

Commit 963c4a6

Browse files
committed
changed case 6 name and amended case 7 code as advised
1 parent ff38621 commit 963c4a6

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎practice-tdd/get-ordinal-number.test.js‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ import { getOrdinalNumber } from "./get-ordinal-number.js";
1212
// Case 1: Numbers ending with 1 (but not 11)
1313
// When the number ends with 1, except those ending with 11,
1414
// Then the function should return a string by appending "st" to the number.
15-
16-
// Case 1: Numbers ending with 1 (but not 11).
1715
test("should append 'st' for numbers ending with 1, except those ending with 11", () => {
1816
expect(getOrdinalNumber(1)).toEqual("1st");
1917
expect(getOrdinalNumber(21)).toEqual("21st");
@@ -51,14 +49,14 @@ test("should append 'th' for numbers 11, 12, 13", () => {
5149
expect(getOrdinalNumber(113)).toEqual("113th");
5250
});
5351

54-
//case 6 now we have come to the last one 0
52+
//case 6 how about when num is 0
5553
test(` should throw an error when num is 0`, () => {
5654
expect(() => getOrdinalNumber(0)).toThrow(`Invalid Input`);
5755
});
5856

5957
//case 7 how about when empty string is the argument
6058
test(`Should throw an error when num is empty string`, () => {
61-
expect(() => getOrdinalNumber(" ")).toThrow(`Invalid Input`);
59+
expect(() => getOrdinalNumber("")).toThrow(`Invalid Input`);
6260
});
6361
// Case 8 how about when num is -ve number
6462
test(`should throw an Error when num is -ve number`, () => {

0 commit comments

Comments
 (0)