-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.test.ts
29 lines (26 loc) · 857 Bytes
/
index.test.ts
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
import assert from 'node:assert/strict';
import { describe, it } from 'node:test';
import { getInput } from '../../../utils/file.ts';
import { part1, part2 } from './index.ts';
const input = (await getInput(import.meta.dirname)).split('\n');
describe('2016 Day 3', () => {
describe('Part 1', () => {
it('should sum the sector IDs of real rooms', () => {
assert.strictEqual(
part1([
'aaaaa-bbb-z-y-x-123[abxyz]',
'a-b-c-d-e-f-g-h-987[abcde]',
'not-a-real-room-404[oarel]',
'totally-real-room-200[decoy]',
]),
1514,
);
assert.strictEqual(part1(input), 278221);
});
});
describe('Part 2', () => {
it('should find the sector ID of the room where the northpole objects are being stored', () => {
assert.strictEqual(part2(input), 267);
});
});
});