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.
This commit is contained in:
Oliver Eyton-Williams
2021-10-22 18:51:46 +02:00
parent edf3185b2b
commit 32c0995e47
3 changed files with 43 additions and 23 deletions

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 = {