adventofcode/2022/03/test.js
2022-12-03 15:26:15 -05:00

26 lines
579 B
JavaScript

import { test, expect, describe } from "vitest";
import { solutionPart1, sample, puzzleInput } from "./part1.js";
import { solutionPart2 } from "./part2.js";
function expectSolution(result) {
console.info(result);
return expect(result);
}
describe("part 1", () => {
test("sample", () => {
expect(solutionPart1(sample)).toEqual(157);
});
test("solution", () => {
expectSolution(solutionPart1(puzzleInput)).toEqual(8515);
});
});
describe("part 2", () => {
test("solution", () => {
expectSolution(solutionPart2(puzzleInput)).toEqual(2434);
});
});