mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-03-18 07:03:01 -04:00
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:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user