adventofcode/2022/11/test.js
2022-12-11 19:38:10 -05:00

28 lines
767 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("readInput", () => {
expect(sample[0]).toMatchObject({ divisible: 23, items: [79, 98] });
});
test("sample", () => {
expect(part1(sample)).toEqual(10605);
});
test("solution", () => {
expectSolution(part1(puzzleInput)).toEqual(58794);
});
});
describe.only("part 2", () => {
test.skip("sample", () => {
expect(part2(sample)).toEqual(2713310158);
});
test("solution", () => {
expectSolution(part2(puzzleInput)).toBeLessThan(32239420356);
expectSolution(part2(puzzleInput)).toEqual(20151213744);
});
});