summaryrefslogtreecommitdiff
path: root/aoc_2021/day-01/example.test.ts
blob: 329dd728baffc1baabe3b24590441fc194ee68e5 (plain)
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
import { expect, test } from "bun:test";
import { main as part1 } from "./part_1";
import { main as part2 } from "./part_2";

const example = `199
200
208
210
200
207
240
269
260
263`.split("\n");

test("part1", async () => {
  const answer = 7;
  const res = await part1(example);
  expect(res).toEqual(answer);
});

test("part2", async () => {
  const answer = 5;
  const res = await part2(example);
  expect(res).toEqual(answer);
});