From a1e543057f47e19d5b3b71bf7e4328fde6cb378a Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Fri, 20 Feb 2026 12:17:10 -0800 Subject: [PATCH] Refactor markdown test to read from file instead of hardcoded strings --- src/test-markdown.ts | 34 +++------------------------------- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/src/test-markdown.ts b/src/test-markdown.ts index c8ef41a..1ce6c1c 100644 --- a/src/test-markdown.ts +++ b/src/test-markdown.ts @@ -1,34 +1,6 @@ import { renderMarkdown } from "./markdown" -const lines = [ - "This is **bold** text", - "This is *italic* text", - "This is `inline code` text", - "Mix of **bold**, *italic*, and `code` in one line", - "**bold with `code` inside** bold", - "No markdown here", - "Multiple **bold one** and **bold two**", - "Nested-ish: **bold and *italic* together**", -] +const file = Bun.file("test/MARKDOWN.md") +const content = await file.text() -for (const line of lines) { - console.log(` ${line}`) - console.log(` ${renderMarkdown(line)}`) - console.log() -} - -// Code fence tests -console.log("--- Code fence tests ---") -const fenceTests = [ - "Here is some code:\n```typescript\nconst x = 1\n```\nDone.", - "```\nhello\n```", - "```js\nconsole.log('hi')\n```", -] - -for (const test of fenceTests) { - console.log("INPUT:") - console.log(test) - console.log("OUTPUT:") - console.log(renderMarkdown(test)) - console.log() -} +console.log(renderMarkdown(content))