feat: overlay manifests for the two reference courses
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c78c7ec8d8
commit
b8c65626f9
3 files changed
+700
No files matched your search
@@ -0,0 +1,32 @@
|
||||
import { describe, expect, test } from "bun:test";
|
||||
import { existsSync } from "node:fs";
|
||||
import { resolve } from "node:path";
|
||||
import { createCourseRepository, extractHints } from "../src/index";
|
||||
|
||||
const overlays = resolve(import.meta.dir, "../../../overlays");
|
||||
const snakeRoot = "/home/user/functional-programming-course";
|
||||
const systemicRoot = "/home/user/systemic-design-course";
|
||||
|
||||
describe("reference courses", () => {
|
||||
test.skipIf(!existsSync(snakeRoot))("pure-snake loads cleanly", async () => {
|
||||
const repo = await createCourseRepository([overlays]);
|
||||
const c = repo.get("pure-snake")!;
|
||||
expect(c.diagnostics.filter((d) => d.level === "error")).toEqual([]);
|
||||
expect(c.status).toBe("ok");
|
||||
expect(c.manifest!.modules).toHaveLength(13);
|
||||
expect(c.lessonIndex.has("m03-ex-move")).toBe(true);
|
||||
const hints = c.lessonIndex.get("m03-ex-move")!.lesson.hints!;
|
||||
const md = await Bun.file(repo.resolvePath("pure-snake", hints.file)!).text();
|
||||
expect(extractHints(md, hints.match)).toHaveLength(3);
|
||||
expect(await repo.readLessonMarkdown("pure-snake", "m03-ex-move")).toStartWith("### Exercise 3.1");
|
||||
});
|
||||
|
||||
test.skipIf(!existsSync(systemicRoot))("systemic-design loads cleanly", async () => {
|
||||
const repo = await createCourseRepository([overlays]);
|
||||
const c = repo.get("systemic-design")!;
|
||||
expect(c.diagnostics.filter((d) => d.level === "error")).toEqual([]);
|
||||
expect(c.status).toBe("ok");
|
||||
expect(c.manifest!.modules).toHaveLength(11);
|
||||
expect(c.manifest!.gating).toBe("sequential");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user