From 1eea0868becd3174bdcb88256e1aa922577f6c4e Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Wed, 20 Dec 2023 00:05:41 +0100 Subject: [PATCH] test: disable meta order checks (#52625) --- curriculum/test/test-challenges.js | 93 +++++++++++++++--------------- 1 file changed, 47 insertions(+), 46 deletions(-) diff --git a/curriculum/test/test-challenges.js b/curriculum/test/test-challenges.js index 104955a48f5..b691a91c2df 100644 --- a/curriculum/test/test-challenges.js +++ b/curriculum/test/test-challenges.js @@ -42,7 +42,8 @@ const { getLines } = require('../../shared/utils/get-lines'); const { getChallengesForLang, getMetaForBlock } = require('../get-challenges'); const { challengeSchemaValidator } = require('../schema/challenge-schema'); -const { testedLang, getSuperOrder } = require('../utils'); +// const { testedLang, getSuperOrder } = require('../utils'); +const { testedLang } = require('../utils'); const ChallengeTitles = require('./utils/challenge-titles'); const MongoIds = require('./utils/mongo-ids'); const createPseudoWorker = require('./utils/pseudo-worker'); @@ -275,51 +276,51 @@ function populateTestsForLang({ lang, challenges, meta }) { const challengeTitles = new ChallengeTitles(); const validateChallenge = challengeSchemaValidator(); - if (!process.env.FCC_BLOCK && !process.env.FCC_CHALLENGE_ID) { - describe('Assert meta order', function () { - /** This array can be used to skip a superblock - we'll use this - * when we are working on the new project-based curriculum for - * a superblock (because keeping those challenges in order is - * tricky and needs cleaning up before deploying). - */ - const superBlocksUnderDevelopment = [ - '2022/javascript-algorithms-and-data-structures' - ]; - const superBlocks = new Set([ - ...Object.values(meta) - .map(el => el.superBlock) - .filter(el => !superBlocksUnderDevelopment.includes(el)) - ]); - superBlocks.forEach(superBlock => { - const filteredMeta = Object.values(meta) - .filter(el => el.superBlock === superBlock) - .sort((a, b) => a.order - b.order); - if (!filteredMeta.length) { - return; - } - it(`${superBlock} should have the same order in every meta`, function () { - const firstOrder = getSuperOrder(filteredMeta[0].superBlock, { - showNewCurriculum: process.env.SHOW_NEW_CURRICULUM - }); - assert.isNumber(firstOrder); - assert.isTrue( - filteredMeta.every( - el => - getSuperOrder(el.superBlock, { - showNewCurriculum: process.env.SHOW_NEW_CURRICULUM - }) === firstOrder - ), - 'The superOrder properties are mismatched.' - ); - }); - filteredMeta.forEach((meta, index) => { - it(`${meta.superBlock} ${meta.name} must be in order`, function () { - assert.equal(meta.order, index); - }); - }); - }); - }); - } + // if (!process.env.FCC_BLOCK && !process.env.FCC_CHALLENGE_ID) { + // describe('Assert meta order', function () { + // /** This array can be used to skip a superblock - we'll use this + // * when we are working on the new project-based curriculum for + // * a superblock (because keeping those challenges in order is + // * tricky and needs cleaning up before deploying). + // */ + // const superBlocksUnderDevelopment = [ + // '2022/javascript-algorithms-and-data-structures' + // ]; + // const superBlocks = new Set([ + // ...Object.values(meta) + // .map(el => el.superBlock) + // .filter(el => !superBlocksUnderDevelopment.includes(el)) + // ]); + // superBlocks.forEach(superBlock => { + // const filteredMeta = Object.values(meta) + // .filter(el => el.superBlock === superBlock) + // .sort((a, b) => a.order - b.order); + // if (!filteredMeta.length) { + // return; + // } + // it(`${superBlock} should have the same order in every meta`, function () { + // const firstOrder = getSuperOrder(filteredMeta[0].superBlock, { + // showNewCurriculum: process.env.SHOW_NEW_CURRICULUM + // }); + // assert.isNumber(firstOrder); + // assert.isTrue( + // filteredMeta.every( + // el => + // getSuperOrder(el.superBlock, { + // showNewCurriculum: process.env.SHOW_NEW_CURRICULUM + // }) === firstOrder + // ), + // 'The superOrder properties are mismatched.' + // ); + // }); + // filteredMeta.forEach((meta, index) => { + // it(`${meta.superBlock} ${meta.name} must be in order`, function () { + // assert.equal(meta.order, index); + // }); + // }); + // }); + // }); + // } describe(`Check challenges (${lang})`, function () { this.timeout(5000);