adventofcode/2022/08/test.js

26 lines
634 B
JavaScript
Raw Normal View History

2022-12-08 16:15:24 +00:00
import { test, expect, describe } from "vitest";
import { expectSolution } from "../01/main.js";
2022-12-08 21:19:44 +00:00
import part1, { sample, puzzleInput } from "./part1.js";
2022-12-08 16:15:24 +00:00
import part2 from "./part2.js";
describe("part 1", () => {
2022-12-08 21:19:44 +00:00
test("sample", () => {
expect(part1(sample)).toBe(21);
});
2022-12-08 16:15:24 +00:00
test("solution", () => {
expectSolution(part1(puzzleInput)).toEqual(1703);
});
});
describe("part 2", () => {
2022-12-08 21:19:44 +00:00
test("sample", () => {
expect(part2(sample)).toBe(8);
});
test("solution", () => {
const solution = part2(puzzleInput);
expect(solution).toBeGreaterThan(160);
expectSolution(solution).toEqual(496650);
2022-12-08 16:15:24 +00:00
});
});