fix: add more tests for curriclum testing (#38464)

Co-Authored-By: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
Tom
2020-04-23 12:01:15 -05:00
committed by GitHub
parent 35898e27f8
commit 560aacd4eb
6 changed files with 294 additions and 189 deletions

View File

@ -2,6 +2,7 @@ const path = require('path');
const { findIndex } = require('lodash');
const readDirP = require('readdirp-walk');
const { parseMarkdown } = require('@freecodecamp/challenge-md-parser');
const fs = require('fs');
const { dasherize } = require('../utils/slugs');
@ -14,7 +15,14 @@ function getChallengesDirForLang(lang) {
return path.resolve(challengesDir, `./${lang}`);
}
function getMetaForBlock(block) {
return JSON.parse(
fs.readFileSync(path.resolve(metaDir, `./${block}/meta.json`), 'utf8')
);
}
exports.getChallengesDirForLang = getChallengesDirForLang;
exports.getMetaForBlock = getMetaForBlock;
exports.getChallengesForLang = function getChallengesForLang(lang) {
let curriculum = {};