mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-11 07:00:41 -04:00
test: disable meta order checks (#52625)
This commit is contained in:
committed by
GitHub
parent
7118d0e696
commit
1eea0868be
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user