From a84cf7e674a203abbbbd8454b350e0de8d475e1a Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Thu, 13 Nov 2025 16:45:29 -0800 Subject: [PATCH] Refactor: Export test case inputs for debug page --- tests/5_markdown_parser/test.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/5_markdown_parser/test.js b/tests/5_markdown_parser/test.js index e4d0266..18ceced 100644 --- a/tests/5_markdown_parser/test.js +++ b/tests/5_markdown_parser/test.js @@ -5,8 +5,12 @@ export default { // - You MUST use dynamic import() to load one or more libraries from a CDN to help with parsing. // - The function should handle: headers (h1-h6), bold, italic, links, code blocks, inline code, lists (ordered/unordered), and blockquotes. // - Return the resulting HTML string.`, - runTest: async (parseMarkdown) => { + getTestCases: () => { const markdown = `# Hello World\n\nThis is **bold** and *italic*.\n\n- Item 1\n- Item 2\n\n\`\`\`js\nconst x = 5;\n\`\`\``; + return [markdown]; + }, + runTest: async (parseMarkdown) => { + const [markdown] = globalThis.getTestCases ? globalThis.getTestCases() : this.getTestCases(); const html = await parseMarkdown(markdown); const doc = new DOMParser().parseFromString(html, 'text/html'); const selectors = ['h1', 'strong', 'em', 'ul', 'code'];