-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.test.ts
49 lines (38 loc) · 1.05 KB
/
template.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import * as fs from "fs";
import * as path from "path";
import { getResult, getResultPart2 } from "../day$day";
const input = ``;
describe("Advent of Code $year", () => {
describe("Day $day", () => {
it("returns the result", () => {
const actual = getResult(input);
expect(actual).toBe(0);
});
it("returns the result - file input", () => {
const fileInput = fs.readFileSync(
path.resolve(__dirname, "../day$day.txt"),
{
encoding: "utf8",
flag: "r",
}
);
const actual = getResult(fileInput);
expect(actual).toBe(0);
});
it("returns the result part 2", () => {
const actual = getResultPart2(input);
expect(actual).toBe(0);
});
it("returns the result part 2 - file input", () => {
const fileInput = fs.readFileSync(
path.resolve(__dirname, "../day$day.txt"),
{
encoding: "utf8",
flag: "r",
}
);
const actual = getResultPart2(fileInput);
expect(actual).toBe(0);
});
});
});