Skip to content

Commit 8f12144

Browse files
till test and till js
1 parent f6e77dd commit 8f12144

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎Sprint-2/stretch/till.test.js‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
const totalTill = require("./till.js");
2+
3+
test("calculates the total amount in the till", () => {
4+
const till = {
5+
"1p": 10,
6+
"5p": 6,
7+
"50p": 4,
8+
"20p": 10,
9+
};
10+
11+
expect(totalTill(till)).toBe("£4.4");
12+
});
13+
14+
test("returns £0 for an empty till", () => {
15+
expect(totalTill({})).toBe("£0");
16+
});

0 commit comments

Comments
 (0)