From fa0d4957f354fa7744326b0b4445f9fb548afd8a Mon Sep 17 00:00:00 2001 From: Nico Rehwaldt Date: Mon, 21 Dec 2020 09:50:14 +0100 Subject: [PATCH] chore: simplify translation collection Use same global variable in node and within the specs. --- test/config/karma.unit.js | 5 +---- test/config/translation-reporter.js | 2 -- test/helper/index.js | 2 +- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/test/config/karma.unit.js b/test/config/karma.unit.js index b70a7693..458b8364 100644 --- a/test/config/karma.unit.js +++ b/test/config/karma.unit.js @@ -92,10 +92,7 @@ module.exports = function(karma) { if (collectTranslations) { config.plugins = [].concat(config.plugins || [], 'karma-*', require('./translation-reporter')); config.reporters = [].concat(config.reporters || [], 'translation-reporter'); - - config.envPreprocessor = [ - 'TRANSLATIONS' - ]; + config.envPreprocessor = [].concat(config.envPreprocessor || [], 'COLLECT_TRANSLATIONS'); } karma.set(config); diff --git a/test/config/translation-reporter.js b/test/config/translation-reporter.js index b407bd81..6f2d57a0 100644 --- a/test/config/translation-reporter.js +++ b/test/config/translation-reporter.js @@ -8,8 +8,6 @@ var { function TranslationReporter() { - process.env.TRANSLATIONS = 'enabled'; - var translationsFile = path.join(__dirname, '../../docs/translations.json'); var translations = []; diff --git a/test/helper/index.js b/test/helper/index.js index a9f97a86..7cbf8e94 100644 --- a/test/helper/index.js +++ b/test/helper/index.js @@ -46,7 +46,7 @@ var OPTIONS, BPMN_JS; import translationModule from './TranslationCollector'; -export var collectTranslations = window.__env__ && window.__env__.TRANSLATIONS === 'enabled'; +export var collectTranslations = window.__env__ && window.__env__.COLLECT_TRANSLATIONS; // inject logging translation module into default modules if (collectTranslations) {