Revert: Update test.js

This commit is contained in:
2025-11-13 16:49:43 -08:00
parent 9c33f7f591
commit 3f447fead4

View File

@@ -5,12 +5,8 @@ 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.`,
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 markdown = `# Hello World\n\nThis is **bold** and *italic*.\n\n- Item 1\n- Item 2\n\n\`\`\`js\nconst x = 5;\n\`\`\``;
const html = await parseMarkdown(markdown);
const doc = new DOMParser().parseFromString(html, 'text/html');
const selectors = ['h1', 'strong', 'em', 'ul', 'code'];
@@ -20,3 +16,4 @@ export default {
}
}
};