Skip to content

Commit 793f81b

Browse files
authored
fix(client): allow identical challenge ids multiple superblocks (freeCodeCamp#61982)
1 parent a40fe34 commit 793f81b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

curriculum/test/test-challenges.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,6 @@ async function getChallenges(lang, filters) {
235235
}
236236

237237
function populateTestsForLang({ lang, challenges, meta, superBlocks }) {
238-
const mongoIds = new MongoIds();
239-
const challengeTitles = new ChallengeTitles();
240238
const validateChallenge = challengeSchemaValidator();
241239

242240
superBlocks.forEach(superBlock => {
@@ -246,6 +244,10 @@ function populateTestsForLang({ lang, challenges, meta, superBlocks }) {
246244
const superBlockChallenges = challenges.filter(
247245
c => c.superBlock === superBlock
248246
);
247+
248+
const challengeTitles = new ChallengeTitles();
249+
const mongoIds = new MongoIds();
250+
249251
superBlockChallenges.forEach((challenge, id) => {
250252
// When testing single challenge, in project based curriculum,
251253
// challenge to test (current challenge) might not have solution.

0 commit comments

Comments
 (0)