diff --git a/curriculum/test/test-challenges.js b/curriculum/test/test-challenges.js index 92f562afa0..648329aaa0 100644 --- a/curriculum/test/test-challenges.js +++ b/curriculum/test/test-challenges.js @@ -27,8 +27,6 @@ const { challengeTypes } = require('../../client/utils/challengeTypes'); const { supportedLangs } = require('../utils'); -const { LOCALE: lang = 'english' } = process.env; - const oldRunnerFail = Mocha.Runner.prototype.fail; Mocha.Runner.prototype.fail = function(test, err) { if (err instanceof AssertionError) { @@ -60,7 +58,15 @@ const jQueryScript = fs.readFileSync( runTests(); async function runTests() { - await Promise.all(supportedLangs.map(lang => populateTestsForLang(lang))); + 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)); + } + + await Promise.all(testLangs.map(lang => populateTestsForLang(lang))); run(); } diff --git a/sample.env b/sample.env index e556cb0891..5e847f5188 100644 --- a/sample.env +++ b/sample.env @@ -28,3 +28,5 @@ API_LOCATION='http://localhost:3000' FORUM_LOCATION='https://forum.localhost' FORUM_PROXY_LOCATION='https://proxy.localhost' LOCALE=english + +TEST_CHALLENGES_FOR_LANGS=english