From 44bedb208426b643244e2cc6e0a3f2c93b41695d Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 20 Feb 2019 09:36:18 +0100 Subject: [PATCH] fix unit tests without breaking the build --- src/languageHandler.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/languageHandler.js b/src/languageHandler.js index 33f703c204..7c1a47fed9 100644 --- a/src/languageHandler.js +++ b/src/languageHandler.js @@ -339,8 +339,9 @@ export function getCurrentLanguage() { function getLangsJson() { return new Promise((resolve, reject) => { // LANGUAGES_FILE is a webpack compile-time define, see webpack config + const url = (typeof LANGUAGES_FILE === "string") ? require(LANGUAGES_FILE) : (i18nFolder + 'languages.json'); request( - { method: "GET", url: require(LANGUAGES_FILE) }, + { method: "GET", url }, (err, response, body) => { if (err || response.status < 200 || response.status >= 300) { reject({err: err, response: response});