adventofcode/2023/04/benchmark.test.js

13 lines
372 B
JavaScript
Raw Normal View History

2023-12-04 17:19:52 +00:00
import { bench, expect } from "vitest";
import { readFileSync } from "fs-extra";
import { parse } from "yaml";
2023-12-04 15:03:46 +00:00
2023-12-04 17:19:52 +00:00
import { solution_1 } from "./part1.js";
2023-12-04 15:03:46 +00:00
2023-12-04 17:19:52 +00:00
const input = readFileSync("./input", { encoding: "utf8" });
const solutions = parse(readFileSync("./solutions.yml", { encoding: "utf8" }));
2023-12-04 15:03:46 +00:00
2023-12-04 17:19:52 +00:00
bench("part 1", () => {
expect(solution_1(input)).toBe(solutions[1]);
2023-12-04 15:03:46 +00:00
});