Skip to content

Commit af59161

Browse files
author
russom
committed
for the last test for invalid input test adjusted so jest can check first and catch the error.
1 parent 1b4063a commit af59161

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const tally = require("./tally.js");
2020
// When passed an array of items
2121
// Then it should return an object containing the count for each unique item
2222
test("tally on an array returns an object with item", function() {
23-
expect(tally(["a"])).etEqual({a: 1})
23+
expect(tally(["a"])).toEqual({a: 1})
2424
})
2525

2626
// Given an empty array
@@ -41,5 +41,5 @@ test("tally on duplicate items returns count of items", function() {
4141
// When passed to tally
4242
// Then it should throw an error
4343
test("tally on invalid input throws an error", function() {
44-
expect(tally("string")).toBe("error")
44+
expect(() => tally("string")).toThrow("Invalid input")
4545
})

0 commit comments

Comments
 (0)