adventofcode/2022/08/test.js
2022-12-08 16:19:44 -05:00

26 lines
634 B
JavaScript

import { test, expect, describe } from "vitest";
import { expectSolution } from "../01/main.js";
import part1, { sample, puzzleInput } from "./part1.js";
import part2 from "./part2.js";
describe("part 1", () => {
test("sample", () => {
expect(part1(sample)).toBe(21);
});
test("solution", () => {
expectSolution(part1(puzzleInput)).toEqual(1703);
});
});
describe("part 2", () => {
test("sample", () => {
expect(part2(sample)).toBe(8);
});
test("solution", () => {
const solution = part2(puzzleInput);
expect(solution).toBeGreaterThan(160);
expectSolution(solution).toEqual(496650);
});
});