adventofcode/2023/preset/day/templates/js/test.js
2023-12-04 10:03:46 -05:00

17 lines
491 B
JavaScript

import { test, expect } from 'vitest';
import { readFileSync } from 'fs-extra';
import { parse } from 'yaml';
import { solution_1 } from './part1.js';
import { solution_2 } from './part2.js';
const input = readFileSync('./input',{ encoding: 'utf8'});
const solutions = parse( readFileSync('./solutions.yml',{encoding:'utf8'}));
test( 'part 1', () => {
expect( solution_1(input)).toBe(solutions['1']);
})
test( 'part 2', () => {
expect( solution_2(input)).toBe(solutions['2']);
})