-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
24 lines (19 loc) · 814 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 reindeer = require('./reindeer');
const reindeer2 = require('./reindeer2');
describe('Day 14: Reindeer Olympics', () => {
it('should calculate fastest reindeer', () => {
const racers =
`Comet can fly 14 km/s for 10 seconds, but then must rest for 127 seconds.
Dancer can fly 16 km/s for 11 seconds, but then must rest for 162 seconds.`;
assert.strictEqual(reindeer(racers, 1000), 1120);
});
describe('Part Two', () => {
it('should calculate highest score reindeer', () => {
const racers =
`Comet can fly 14 km/s for 10 seconds, but then must rest for 127 seconds.
Dancer can fly 16 km/s for 11 seconds, but then must rest for 162 seconds.`;
assert.strictEqual(reindeer2(racers, 1000), 689);
});
});
});