adventofcode/2022/04/test.js

24 lines
621 B
JavaScript
Raw Permalink Normal View History

2022-12-04 17:42:17 +00:00
import { test, describe } from "vitest";
2022-12-04 17:37:18 +00:00
import { expectSolution } from "../01/main.js";
2022-12-04 17:42:17 +00:00
import { solutionPart1, puzzleInput, sample } from "./part1.js";
2022-12-04 17:37:18 +00:00
import { solutionPart2 } from "./part2.js";
describe("part 1", () => {
test("sample", () => {
expectSolution(solutionPart1(sample)).toEqual(2);
});
test("solution", () => {
2022-12-04 17:42:17 +00:00
expectSolution(solutionPart1(puzzleInput)).toEqual(605);
2022-12-04 17:37:18 +00:00
});
});
describe("part 2", () => {
2022-12-04 17:42:17 +00:00
test("sample", () => {
expectSolution(solutionPart2(sample)).toEqual(4);
});
test("solution", () => {
expectSolution(solutionPart2(puzzleInput)).toEqual(914);
2022-12-04 17:37:18 +00:00
});
});