fix unit tests without breaking the build
This commit is contained in:
parent
6bf8269bcd
commit
44bedb2084
1 changed files with 2 additions and 1 deletions
|
@ -339,8 +339,9 @@ export function getCurrentLanguage() {
|
||||||
function getLangsJson() {
|
function getLangsJson() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
// LANGUAGES_FILE is a webpack compile-time define, see webpack config
|
// LANGUAGES_FILE is a webpack compile-time define, see webpack config
|
||||||
|
const url = (typeof LANGUAGES_FILE === "string") ? require(LANGUAGES_FILE) : (i18nFolder + 'languages.json');
|
||||||
request(
|
request(
|
||||||
{ method: "GET", url: require(LANGUAGES_FILE) },
|
{ method: "GET", url },
|
||||||
(err, response, body) => {
|
(err, response, body) => {
|
||||||
if (err || response.status < 200 || response.status >= 300) {
|
if (err || response.status < 200 || response.status >= 300) {
|
||||||
reject({err: err, response: response});
|
reject({err: err, response: response});
|
||||||
|
|
Loading…
Reference in a new issue