aoc/2022/day_01/solution.test.ts

28 lines
826 B
TypeScript

import { readlines } from "../../_utils";
const solution = require("./solution");
describe("day 1: calorie counting, pt 1", () => {
test("sample input", async () => {
const sample = await readlines("./day_01/sample.txt");
expect(solution.part1_solver(sample)).toBe(24000);
});
test("submission input", async () => {
const input = await readlines("./day_01/input.txt");
expect(solution.part1_solver(input)).toBe(70613);
});
});
describe("day 1: calorie counting, pt 2", () => {
test("sample input", async () => {
const sample = await readlines("./day_01/sample.txt");
expect(solution.part2_solver(sample)).toBe(45000);
});
test("submission input", async () => {
const input = await readlines("./day_01/input.txt");
expect(solution.part2_solver(input)).toBe(205805);
});
});