test: enable tests for steps (#44550)

* fix: handle missing solutions correctly

Rather than creating an [[]] the parser now creates [] which isEmpty().
This makes the test suite check the next challenge for a solution.

In addition, the logic for testing solutions was fixed.

* chore: update snapshots

* test: build new superblock in node.js-tests CI

* test: allow forward slash in superblock slug

* fix: borked tests oops

* test: ignore duplicated projects

* fix: i did not break these shaun did :)

* fix: idIndex is index of id not id

Co-authored-by: Nicholas Carrigan <nhcarrigan@gmail.com>
This commit is contained in:
Oliver Eyton-Williams
2021-12-22 20:18:06 +00:00
committed by GitHub
parent 4be4bf3624
commit 36363f277d
141 changed files with 267 additions and 201 deletions

View File

@ -12,9 +12,7 @@ Object {
a container directive
:::</p>
</section>",
"solutions": Array [
Array [],
],
"solutions": Array [],
"tests": Array [],
}
`;
@ -43,9 +41,7 @@ Object {
<pre><code class=\\"language-js\\"> var x = 'y';
</code></pre>",
},
"solutions": Array [
Array [],
],
"solutions": Array [],
"tests": Array [],
}
`;
@ -100,9 +96,7 @@ for (let index = 0; index < array.length; index++) {
<pre><code class=\\"language-html\\">code example 0
</code></pre>
</section>",
"solutions": Array [
Array [],
],
"solutions": Array [],
"tests": Array [
Object {
"testString": "// test code",
@ -166,9 +160,7 @@ Object {
<pre><code class=\\"language-html\\">code example 0
</code></pre>
</section>",
"solutions": Array [
Array [],
],
"solutions": Array [],
"tests": Array [
Object {
"testString": "// test code",
@ -516,9 +508,7 @@ Object {
"forumTopicId": 18276,
"id": "bd7123c8c441eddfaeb5bdef",
"isHidden": false,
"solutions": Array [
Array [],
],
"solutions": Array [],
"tests": Array [
Object {
"testString": "// test code",

View File

@ -1,3 +1,4 @@
const { isEmpty } = require('lodash');
const { root } = require('mdast-builder');
const visitChildren = require('unist-util-visit-children');
@ -30,7 +31,7 @@ function createPlugin() {
);
visitForContents(solutionTree);
solutions.push(Object.values(solution));
if (!isEmpty(solution)) solutions.push(Object.values(solution));
});
file.data = {