Fix languageHandler's use of $webapp languages.json for Jest

pull/21833/head
Travis Ralston 2020-01-09 17:22:50 -07:00
parent ffd037dfa8
commit 4dfbce3108
1 changed files with 2 additions and 2 deletions

View File

@ -419,9 +419,9 @@ export function pickBestLanguage(langs) {
function getLangsJson() { function getLangsJson() {
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
let url; let url;
try { if (typeof(webpackLangJsonUrl) === 'string') { // in Jest this 'url' isn't a URL, so just fall through
url = webpackLangJsonUrl; url = webpackLangJsonUrl;
} catch (e) { } else {
url = i18nFolder + 'languages.json'; url = i18nFolder + 'languages.json';
} }
request( request(