26 lines
579 B
JavaScript
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);
|
|
});
|
|
});
|