-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
34 lines (29 loc) · 1.23 KB
/
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
25
26
27
28
29
30
31
32
33
34
const assert = require('assert');
const sum = require('./sum');
const sum2 = require('./sum2');
describe('Day 7: The Sum of Its Parts', () => {
it('should determine order of steps', () => {
const instructions =
`Step C must be finished before step A can begin.
Step C must be finished before step F can begin.
Step A must be finished before step B can begin.
Step A must be finished before step D can begin.
Step B must be finished before step E can begin.
Step D must be finished before step E can begin.
Step F must be finished before step E can begin.`;
assert.strictEqual(sum(instructions), 'CABDFE');
});
describe('Part Two', () => {
it('should determine work duration', () => {
const instructions =
`Step C must be finished before step A can begin.
Step C must be finished before step F can begin.
Step A must be finished before step B can begin.
Step A must be finished before step D can begin.
Step B must be finished before step E can begin.
Step D must be finished before step E can begin.
Step F must be finished before step E can begin.`;
assert.strictEqual(sum2(instructions, 2, 0), 15);
});
});
});