-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
28 lines (22 loc) · 822 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
25
26
27
28
const assert = require('assert');
const fireHazard = require('./fire-hazard');
const fireHazard2 = require('./fire-hazard2');
describe('Day 6: Probably a Fire Hazard', () => {
it('should turn on every light', () => {
assert.equal(fireHazard('turn on 0,0 through 999,999'), 1000000);
});
it('should toggle first line', () => {
assert.equal(fireHazard('toggle 0,0 through 999,0'), 1000);
});
it('should turn off 2x2 center lights', () => {
assert.equal(fireHazard('turn off 499,499 through 500,500'), 0);
});
describe('Part Two', () => {
it('should increase brightness by 1', () => {
assert.equal(fireHazard2('turn on 0,0 through 0,0'), 1);
});
it('should toggle first line', () => {
assert.equal(fireHazard2('toggle 0,0 through 999,999'), 2000000);
});
});
});