Skip to content

Commit cbed42f

Browse files
committed
add aitional tests to check if input is not an array
1 parent c83a6e2 commit cbed42f

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

‎Sprint-2/implement/tally.test.js‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,15 @@ describe("tally()", () => {
5050
// Given an invalid input like a string
5151
// When passed to tally
5252
// Then it should throw an error
53-
describe("when given invalid input such as a string", () => {
54-
test("should throw an error", () => {
53+
describe("when given invalid input", () => {
54+
test("should throw an error for a string input", () => {
5555
expect(() => tally("apple")).toThrow("Input should be an array");
5656
});
57+
test("should throw an error for a boolean input", () => {
58+
expect(() => tally(true)).toThrow("Input should be an array");
59+
});
60+
test("should throw an error for a number input", () => {
61+
expect(() => tally(3)).toThrow("Input should be an array");
62+
});
5763
});
5864
});

0 commit comments

Comments
 (0)