feat: Lint curriculum, including test yaml

This commit is contained in:
Oliver Eyton-Williams
2019-04-12 16:44:14 +02:00
committed by mrugesh
parent 7d4dc382b4
commit 538e0bbee3
9 changed files with 491 additions and 97 deletions

View File

@ -27,8 +27,6 @@ const jsdom = require('jsdom');
const dom = new jsdom.JSDOM('');
global.document = dom.window.document;
require('dotenv').config({ path: path.resolve(__dirname, '../../.env') });
const vm = require('vm');
const puppeteer = require('puppeteer');
@ -40,7 +38,7 @@ const ChallengeTitles = require('./utils/challengeTitles');
const { challengeSchemaValidator } = require('../schema/challengeSchema');
const { challengeTypes } = require('../../client/utils/challengeTypes');
const { supportedLangs } = require('../utils');
const { testedLangs } = require('../utils');
const {
buildDOMChallenge,
@ -88,13 +86,7 @@ async function runTests() {
throw new Error(`unhandledRejection: ${err.name}, ${err.message}`);
});
let testLangs = [...supportedLangs];
if (process.env.TEST_CHALLENGES_FOR_LANGS) {
const filterLangs = process.env.TEST_CHALLENGES_FOR_LANGS.split(',').map(
lang => lang.trim().toLowerCase()
);
testLangs = testLangs.filter(lang => filterLangs.includes(lang));
}
const testLangs = testedLangs();
const challenges = await Promise.all(
testLangs.map(lang => getChallenges(lang))