From 7630389829e2480db00c6ec356efdb98d9f23e95 Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Wed, 20 Dec 2023 08:53:22 +0100 Subject: [PATCH] fix: helpful error if solution missing (#52603) --- curriculum/test/test-challenges.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/curriculum/test/test-challenges.js b/curriculum/test/test-challenges.js index 60549326a24..29e65636f69 100644 --- a/curriculum/test/test-challenges.js +++ b/curriculum/test/test-challenges.js @@ -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,