-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparse.test.ts
More file actions
29 lines (24 loc) · 761 Bytes
/
parse.test.ts
File metadata and controls
29 lines (24 loc) · 761 Bytes
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
import { getAllFiles } from "./files";
import { resolve, join } from "path";
import { getAllMetaData } from "./parse";
test("parse front matter for all files", async () => {
expect.assertions(1);
const testPath = resolve("./test");
const files = await getAllFiles(testPath, [], true);
const meta = await getAllMetaData(files);
expect(meta).toEqual({
[join(testPath, "202.py")]: {
title: "Happy Number",
number: 202,
links: ["https://leetcode.com/problems/happy-number/"],
difficulty: "easy",
},
[join(testPath, "412.py")]: {
title: "Fizz Buzz",
number: 412,
links: ["https://leetcode.com/problems/fizz-buzz/"],
difficulty: "easy",
tags: ["fizz buzz", "modulus"],
},
});
});