Package: Validate challenges on test (#17216)
This PR allows us to validate the schema during test. It also removes some cruft from the seed files and ensures only the required data is packaged and consumable, reducing the package weight somewhat.
This commit is contained in:
committed by
mrugesh mohapatra
parent
afc948890c
commit
4e645a5ff6
@@ -2,6 +2,7 @@
|
||||
// no import here as this runs without babel
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const omit = require('lodash/omit');
|
||||
|
||||
const hiddenFile = /(^(\.|\/\.))|(.md$)/g;
|
||||
|
||||
@@ -52,6 +53,24 @@ module.exports = function getChallenges(challengesDir) {
|
||||
challengeSpec.fileName = data.file;
|
||||
challengeSpec.superBlock = superInfo.name;
|
||||
challengeSpec.superOrder = superInfo.order;
|
||||
challengeSpec.challenges = challengeSpec.challenges
|
||||
.map(challenge => omit(
|
||||
challenge,
|
||||
[
|
||||
'betaSolutions',
|
||||
'betaTests',
|
||||
'hints',
|
||||
'MDNlinks',
|
||||
'null',
|
||||
'rawSolutions',
|
||||
'react',
|
||||
'reactRedux',
|
||||
'redux',
|
||||
'releasedOn',
|
||||
'translations',
|
||||
'type'
|
||||
]
|
||||
));
|
||||
return challengeSpec;
|
||||
});
|
||||
};
|
||||
|
Reference in New Issue
Block a user