moving v2 to top level

This commit is contained in:
2024-12-17 09:19:21 -07:00
parent 5f0b3554dc
commit 576ee02afb
468 changed files with 79 additions and 15430 deletions

View File

@@ -0,0 +1,38 @@
import { describe, expect, it } from "vitest";
import { lectureToString } from "../fileStorage/utils/lectureUtils";
import { parseLecture } from "../fileStorage/utils/lectureUtils";
import { Lecture } from "@/models/local/lecture";
describe("can parse and stringify lectures", () => {
it("can parse lecture", () => {
const rawLecture = `
Name: some name
Date: 6/22/2024
---
this is the lecture
content`;
const parsed = parseLecture(rawLecture);
expect(parsed.name).toBe("some name");
expect(parsed.date).toBe("6/22/2024");
expect(parsed.content).toBe(`this is the lecture
content`);
});
it("parsing and stringification is deterministic", () => {
const lecture: Lecture = {
name: "test lecture",
date: "06/*22/2024",
content: `some content
- with
- a
- list`,
};
const rawLecture = lectureToString(lecture);
const parsedLecture = parseLecture(rawLecture);
expect(parsedLecture).toStrictEqual(lecture);
});
});