-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
24 lines (19 loc) · 835 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const assert = require('assert');
const cookie = require('./cookie');
const cookie2 = require('./cookie2');
describe('Day 15: Science for Hungry People', () => {
it('should calculate highest scoring cookie', () => {
const ingredients =
`Butterscotch: capacity -1, durability -2, flavor 6, texture 3, calories 8
Cinnamon: capacity 2, durability 3, flavor -2, texture -1, calories 3`;
assert.strictEqual(cookie(ingredients), 62842880);
});
describe('Part Two', () => {
it('should calculate highest scoring 500 calorie cookie', () => {
const ingredients =
`Butterscotch: capacity -1, durability -2, flavor 6, texture 3, calories 8
Cinnamon: capacity 2, durability 3, flavor -2, texture -1, calories 3`;
assert.strictEqual(cookie2(ingredients), 57600000);
});
});
});