2023-12-02 06:01:12 +00:00
|
|
|
import path from "path";
|
2023-12-02 01:01:55 +00:00
|
|
|
import { readlines } from "../../_utils";
|
2022-12-03 22:11:42 +00:00
|
|
|
|
|
|
|
const solution = require("./solution");
|
|
|
|
|
|
|
|
describe("day 2: rock paper scissors, pt 1", () => {
|
|
|
|
test("sample input", async () => {
|
2023-12-02 06:01:12 +00:00
|
|
|
const sample = await readlines(path.resolve(__dirname, "./sample.txt"));
|
2022-12-03 22:11:42 +00:00
|
|
|
expect(solution.part1_solver(sample)).toBe(15);
|
|
|
|
});
|
|
|
|
|
|
|
|
test("submission input", async () => {
|
2023-12-02 06:01:12 +00:00
|
|
|
const input = await readlines(path.resolve(__dirname, "./input.txt"));
|
2022-12-03 22:11:42 +00:00
|
|
|
expect(solution.part1_solver(input)).toBe(13675);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe("day 2: rock paper scissors, pt 2", () => {
|
|
|
|
test("sample input", async () => {
|
2023-12-02 06:01:12 +00:00
|
|
|
const sample = await readlines(path.resolve(__dirname, "./sample.txt"));
|
2022-12-03 22:11:42 +00:00
|
|
|
expect(solution.part2_solver(sample)).toBe(12);
|
|
|
|
});
|
|
|
|
|
|
|
|
test("submission input", async () => {
|
2023-12-02 06:01:12 +00:00
|
|
|
const input = await readlines(path.resolve(__dirname, "./input.txt"));
|
2022-12-03 22:11:42 +00:00
|
|
|
expect(solution.part2_solver(input)).toBe(14184);
|
|
|
|
});
|
|
|
|
});
|