fix: helpful error if solution missing (#52603)

This commit is contained in:
Oliver Eyton-Williams
2023-12-20 08:53:22 +01:00
committed by GitHub
parent b7b6cacdd8
commit 7630389829
+16
View File
@@ -466,6 +466,22 @@ function populateTestsForLang({ lang, challenges, meta }) {
if (nextChallenge) {
const solutionFiles = cloneDeep(nextChallenge.challengeFiles);
if (!solutionFiles) {
throw Error(
`No solution found.
Check the next challenge (${nextChallenge.title}): it should have a seed which solves the current challenge.
For example:
# --seed--
## --seed-contents--
\`\`\`js
seed goes here
\`\`\`
`
);
}
const solutionFilesWithEditableContents = solutionFiles.map(
file => ({
...file,