exports[`challenge parser it should parse video questions 1`] = `
Object {
"description": "<section id=\\"description\\">
<p>Paragraph 1</p>
<pre><code class=\\"language-html\\">code example
</code></pre>
</section>",
"instructions": "<section id=\\"instructions\\">
<p>Paragraph 0</p>
<pre><code class=\\"language-html\\">code example 0
</code></pre>
</section>",
"question": Object {
"answers": Array [
"<p>Some inline <code>code</code></p>",
"<p>Some <em>italics</em></p>
<p>A second answer paragraph.</p>",
"<p><code> code in </code> code tags</p>",
],
"solution": 3,
"text": "<p>Question line 1</p>
<pre><code class=\\"language-js\\"> var x = 'y';
</code></pre>",
},
"solutions": Array [
Object {},
],
"tests": Array [],
}
`;
exports[`challenge parser should import md from other files 1`] = `
Object {
"description": "<section id=\\"description\\">
<p>Paragraph 1</p>
<pre><code class=\\"language-html\\">code example
</code></pre>
</section>",
"files": Object {
"indexcss": Object {
"contents": "body {
background: green;
}",
"editableRegionBoundaries": Array [],
"ext": "css",
"head": "",
"id": "",
"key": "indexcss",
"name": "index",
"tail": "",
},
"indexhtml": Object {
"contents": "<html>
<body>
</body>
</html>",
"editableRegionBoundaries": Array [],
"ext": "html",
"head": "",
"id": "",
"key": "indexhtml",
"name": "index",
"tail": "",
},
"indexjs": Object {
"contents": "var x = 'y';
for (let index = 0; index < array.length; index++) {
const element = array[index];
// imported from script.md
}",
"editableRegionBoundaries": Array [],
"ext": "js",
"head": "",
"id": "custom-name",
"key": "indexjs",
"name": "index",
"tail": "",
},
},
"instructions": "<section id=\\"instructions\\">
<p>Paragraph 0</p>
<pre><code class=\\"language-html\\">code example 0
</code></pre>
</section>",
"solutions": Array [
Object {},
],
"tests": Array [
Object {
"testString": "// test code",
"text": "<p>First hint</p>",
},
Object {
"testString": "// more test code",
"text": "<p>Second hint with <code>code</code></p>",
},
],
}
`;
exports[`challenge parser should not mix other YAML with the frontmatter 1`] = `
Object {
"description": "<section id=\\"description\\">
<p>Paragraph 1</p>
<pre><code class=\\"language-html\\">code example
</code></pre>
<pre><code class=\\"language-yaml\\">key:
- subkey: value
anothersubkey: another value
</code></pre>
</section>",
"files": Object {
"indexcss": Object {
"contents": "body {
background: green;
}",
"editableRegionBoundaries": Array [],
"ext": "css",
"head": "",
"id": "",
"key": "indexcss",
"name": "index",
"tail": "",
},
"indexhtml": Object {
"contents": "<html>
<body>
</body>
</html>",
"editableRegionBoundaries": Array [],
"ext": "html",
"head": "",
"id": "",
"key": "indexhtml",
"name": "index",
"tail": "",
},
"indexjs": Object {
"contents": "var x = 'y';",
"editableRegionBoundaries": Array [],
"ext": "js",
"head": "",
"id": "",
"key": "indexjs",
"name": "index",
"tail": "",
},
},
"instructions": "<section id=\\"instructions\\">
<p>Paragraph 0</p>
<pre><code class=\\"language-html\\">code example 0
</code></pre>
</section>",
"solutions": Array [
Object {},
],
"tests": Array [
Object {
"testString": "// test code",
"text": "<p>First hint</p>",
},
Object {
"testString": "// more test code",
"text": "<p>Second hint with <code>code</code></p>",
},
],
}
`;
exports[`challenge parser should parse a more realistic md file 1`] = `
Object {
"description": "<section id=\\"description\\">
<p>When you add a lower rank heading element to the page, it's implied that you're starting a new subsection.</p>
<p>After the last <code>h2</code> element of the second <code>section</code> element, add an <code>h3</code> element with the text <code>Things cats love:</code>.</p>
"text": "<p>There should be an <code>h3</code> element right above the second <code>section</code> element's closing tag.</p>",
},
Object {
"testString": "assert(
document
.querySelectorAll('main > section')[1]
.lastElementChild.innerText.toLowerCase()
.replace(/\\\\s+/g, ' ') === 'things cats love:'
);",
"text": "<p>The <code>h3</code> element right above the second <code>section</code> element's closing tag should have the text <code>Things cats love:</code>. Make sure to include the colon at the end of the text.</p>",
"text": "<p>There should be an <code>h2</code> element with the text <code>Cat Lists</code> above the last <code>h3</code> element that is nested in the last <code>section</code> element'. You may have accidentally deleted the <code>h2</code> element.</p>",
},
],
}
`;
exports[`challenge parser should parse a simple md file 1`] = `
Object {
"description": "<section id=\\"description\\">
<p>Paragraph 1</p>
<pre><code class=\\"language-html\\">code example
</code></pre>
</section>",
"files": Object {
"indexcss": Object {
"contents": "body {
background: green;
}",
"editableRegionBoundaries": Array [],
"ext": "css",
"head": "",
"id": "",
"key": "indexcss",
"name": "index",
"tail": "",
},
"indexhtml": Object {
"contents": "<html>
<body>
</body>
</html>",
"editableRegionBoundaries": Array [],
"ext": "html",
"head": "",
"id": "",
"key": "indexhtml",
"name": "index",
"tail": "",
},
"indexjs": Object {
"contents": "var x = 'y';",
"editableRegionBoundaries": Array [],
"ext": "js",
"head": "",
"id": "",
"key": "indexjs",
"name": "index",
"tail": "",
},
},
"instructions": "<section id=\\"instructions\\">
<p>Paragraph 0</p>
<pre><code class=\\"language-html\\">code example 0
</code></pre>
</section>",
"solutions": Array [
Object {
"indexcss": Object {
"contents": "body {
background: white;
}",
"ext": "css",
"head": "",
"id": "",
"key": "indexcss",
"name": "index",
"tail": "",
},
"indexhtml": Object {
"contents": "<html>
<body>
</body>
</html>",
"ext": "html",
"head": "",
"id": "html-key",
"key": "indexhtml",
"name": "index",
"tail": "",
},
"indexjs": Object {
"contents": "var x = 'y';
\`\`",
"ext": "js",
"head": "",
"id": "",
"key": "indexjs",
"name": "index",
"tail": "",
},
},
],
"tests": Array [
Object {
"testString": "// test code",
"text": "<p>First hint</p>",
},
Object {
"testString": "// more test code",
"text": "<p>Second hint with <code>code</code></p>",
},
Object {
"testString": "// more test code
if(let x of xs) {
console.log(x);
}",
"text": "<p>Third <em>hint</em> with <code>code</code> and <code>inline code</code></p>",
},
],
}
`;
exports[`challenge parser should parse frontmatter 1`] = `
Object {
"challengeType": 0,
"description": "<section id=\\"description\\">
<p>Paragraph 1</p>
<pre><code class=\\"language-html\\">code example
</code></pre>
</section>",
"files": Object {
"indexcss": Object {
"contents": "body {
background: green;
}",
"editableRegionBoundaries": Array [],
"ext": "css",
"head": "",
"id": "",
"key": "indexcss",
"name": "index",
"tail": "",
},
"indexhtml": Object {
"contents": "<html>
<body>
</body>
</html>",
"editableRegionBoundaries": Array [],
"ext": "html",
"head": "",
"id": "",
"key": "indexhtml",
"name": "index",
"tail": "",
},
"indexjs": Object {
"contents": "var x = 'y';",
"editableRegionBoundaries": Array [],
"ext": "js",
"head": "",
"id": "",
"key": "indexjs",
"name": "index",
"tail": "",
},
},
"forumTopicId": 18276,
"id": "bd7123c8c441eddfaeb5bdef",
"isHidden": false,
"solutions": Array [
Object {},
],
"tests": Array [
Object {
"testString": "// test code",
"text": "<p>First hint</p>",
},
Object {
"testString": "// more test code",
"text": "<p>Second hint with <code>code</code></p>",