Skip to content

Commit 3cdb54e

Browse files
refactored the last case and some indentation to the tally.test file
1 parent 6d6cba1 commit 3cdb54e

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,21 @@ const tally = require("./tally.js");
2323
// Given an empty array
2424
// When passed to tally
2525
// Then it should return an empty object
26-
test("tally on an empty array returns an empty object", ()=>{
27-
expect(tally([])).toEqual({})
26+
test("tally on an empty array returns an empty object", () => {
27+
expect(tally([])).toEqual({});
2828
});
2929

3030
// Given an array with duplicate items
3131
// When passed to tally
3232
// Then it should return counts for each unique item
33-
test('tally with duplicate items returns the count for each unique item', ()=>{
34-
expect(tally(["a","b","a","b"])).toEqual({a:2,b:2})
35-
})
36-
33+
test("tally with duplicate items returns the count for each unique item", () => {
34+
expect(tally(["a", "b", "a", "b"])).toEqual({ a: 2, b: 2 });
35+
});
3736

3837
// Given an invalid input like a string, a number, or no argument at all
3938
// When passed to tally
4039
// Then it should throw Error("tally requires an array")
4140

42-
test('tally with invalid input like a string, a number or no argument , throw an error',()=>{
43-
expect(()=>tally("")).toThrow(new Error("tally requires an array")
41+
test("tally with invalid input like a string, a number or no argument , throw an error", () => {
42+
expect(() => tally("")).toThrow(new Error("tally requires an array"));
43+
});

0 commit comments

Comments
 (0)