@@ -8,6 +8,48 @@ import { createMemoryWikiTestHarness } from "./test-helpers.js";
|
8 | 8 | const { createVault } = createMemoryWikiTestHarness(); |
9 | 9 | |
10 | 10 | describe("lintMemoryWikiVault", () => { |
| 11 | +it("accepts native markdown links that include the relative .md target", async () => { |
| 12 | +const { rootDir, config } = await createVault({ |
| 13 | +prefix: "memory-wiki-lint-native-links-", |
| 14 | +config: { |
| 15 | +vault: { renderMode: "native" }, |
| 16 | +}, |
| 17 | +}); |
| 18 | +await Promise.all( |
| 19 | +["entities", "sources"].map((dir) => fs.mkdir(path.join(rootDir, dir), { recursive: true })), |
| 20 | +); |
| 21 | + |
| 22 | +await fs.writeFile( |
| 23 | +path.join(rootDir, "sources", "alpha.md"), |
| 24 | +renderWikiMarkdown({ |
| 25 | +frontmatter: { |
| 26 | +pageType: "source", |
| 27 | +id: "source.alpha", |
| 28 | +title: "Alpha Source", |
| 29 | +}, |
| 30 | +body: "# Alpha Source\n", |
| 31 | +}), |
| 32 | +"utf8", |
| 33 | +); |
| 34 | +await fs.writeFile( |
| 35 | +path.join(rootDir, "entities", "alpha.md"), |
| 36 | +renderWikiMarkdown({ |
| 37 | +frontmatter: { |
| 38 | +pageType: "entity", |
| 39 | +id: "entity.alpha", |
| 40 | +title: "Alpha", |
| 41 | +sourceIds: ["source.alpha"], |
| 42 | +}, |
| 43 | +body: "# Alpha\n\n[Alpha Source](sources/alpha.md)\n", |
| 44 | +}), |
| 45 | +"utf8", |
| 46 | +); |
| 47 | + |
| 48 | +const result = await lintMemoryWikiVault(config); |
| 49 | + |
| 50 | +expect(result.issues.filter((issue) => issue.code === "broken-wikilink")).toEqual([]); |
| 51 | +}); |
| 52 | + |
11 | 53 | it("detects duplicate ids, provenance gaps, contradictions, and open questions", async () => { |
12 | 54 | const { rootDir, config } = await createVault({ |
13 | 55 | prefix: "memory-wiki-lint-", |
|