Skip to content

Commit 4dea38f

Browse files
committed
Remove some error
1 parent 8323d4a commit 4dea38f

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

Sprint-2/implement/contains.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ test("returns true when property exists", () => {
3535
// When passed to contains with a non-existent property name
3636
// Then it should return false
3737
test("return false when property does not exit", () => {
38-
expect(contains({ a: 1, b: 2 }, "c")).to(fasle);
38+
expect(contains({ a: 1, b: 2 }, "c")).toBe(false);
3939
});
4040
// Given invalid parameters like an array
4141
// When passed to contains

Sprint-2/implement/tally.test.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,19 @@ 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 with duplicate items returns correct counts", () => {
23-
expect(tally(['a', 'a', 'b', 'c'])).toEqual({ a: 2, b: 1, c: 1 });
23+
expect(tally(["a", "a", "b", "c"])).toEqual({ a: 2, b: 1, c: 1 });
2424
});
2525

2626
// Given an empty array
2727
// When passed to tally
2828
// Then it should return an empty object
2929
test("tally on an empty array returns an empty object", () => {
30-
expect(tally([])).toEqual({});
30+
expect(tally([])).toEqual({});
3131
});
3232

3333
// Given an array with duplicate items
3434
// When passed to tally
3535
// Then it should return counts for each unique item
36-
const tally = require("./tally.js");
3736

3837
/**
3938
* tally array
@@ -84,4 +83,4 @@ test(" tally throws an error for invalid input", () => {
8483
// Then it should throw an error
8584
test(" tally throws an error for invalid input", () => {
8685
expect(() => tally("not-an-array")).toThrow();
87-
});
86+
});

Sprint-2/stretch/mode.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ function calculateMode(list) {
4242
module.exports = calculateMode;
4343

4444
// Explanation:
45-
getFrequencies(list) //counts how many times each number appears
46-
findMode(freqs) // finds the number with the highest frequency
47-
calculateMode(list) // combines both steps
45+
//getFrequencies(list) //counts how many times each number appears
46+
//findMode(freqs) // finds the number with the highest frequency
47+
//calculateMode(list) // combines both steps

0 commit comments

Comments
 (0)