From 4dfbce31085adccd48079c766b6323d67494eb33 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 9 Jan 2020 17:22:50 -0700 Subject: [PATCH] Fix languageHandler's use of $webapp languages.json for Jest --- src/languageHandler.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/languageHandler.js b/src/languageHandler.js index 3a061df915..ddb7e2718c 100644 --- a/src/languageHandler.js +++ b/src/languageHandler.js @@ -419,9 +419,9 @@ export function pickBestLanguage(langs) { function getLangsJson() { return new Promise(async (resolve, reject) => { let url; - try { + if (typeof(webpackLangJsonUrl) === 'string') { // in Jest this 'url' isn't a URL, so just fall through url = webpackLangJsonUrl; - } catch (e) { + } else { url = i18nFolder + 'languages.json'; } request(