From b6071ae692f9991a746ccaa322d7e70c603a9d4d Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Wed, 3 Sep 2025 17:23:51 +0200 Subject: [PATCH] fix: validate tests exist if filtering for challenges (#62027) --- curriculum/test/test-challenges.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/curriculum/test/test-challenges.js b/curriculum/test/test-challenges.js index 76353cc22c8..479e74b307f 100644 --- a/curriculum/test/test-challenges.js +++ b/curriculum/test/test-challenges.js @@ -152,8 +152,18 @@ async function setup() { await page.setViewport({ width: 300, height: 150 }); const lang = testedLang(); + const challenges = await getChallenges(lang, testFilter); + const nonCertificationChallenges = challenges.filter( + ({ challengeType }) => challengeType !== 7 + ); - let challenges = await getChallenges(lang, testFilter); + if (isEmpty(nonCertificationChallenges)) { + throw Error( + `No challenges to test when using filter ${JSON.stringify(testFilter)} +If the challenge file exists, try running 'build:curriculum' for more information. + ` + ); + } // the next few statements create a list of all blocks and superblocks // as they appear in the list of challenges