Skip to content

Commit f583fd7

Browse files
author
JorvanW
committed
updated tests output for tally.test
1 parent 2c0a94c commit f583fd7

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ test("tally on an array with duplicate items return a count for each item ",()
4141
// When passed to tally
4242
// Then it should throw an error
4343
test("tally with a invalid string should throw an error",() => {
44-
expect(tally('car'))
44+
expect(() => tally('car'))
4545
.toThrow("Input must be an array");
4646
});

‎Sprint-2/interpret/invert.js‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,20 @@ function invert(obj) {
1717
}
1818

1919
// a) What is the current return value when invert is called with { a : 1 }
20+
// { key: 1 }
2021

2122
// b) What is the current return value when invert is called with { a: 1, b: 2 }
23+
// { key: 2 }
2224

2325
// c) What is the target return value when invert is called with {a : 1, b: 2}
26+
// {"1": "a", "2":"b"}
27+
2428

2529
// c) What does Object.entries return? Why is it needed in this program?
30+
// It returns an array of property into the object
2631

2732
// d) Explain why the current return value is different from the target output
33+
// The current return value only shows {key: 2}. It doesn't show the first key and value only the second,
34+
// and it doesn't specify the second key. Its just defined as 'key'
2835

2936
// e) Fix the implementation of invert (and write tests to prove it's fixed!)

0 commit comments

Comments
 (0)