Fix german i18n test which was previously broken due to async

This commit is contained in:
Michael Telatynski 2020-09-15 13:24:20 +01:00
parent 608249745a
commit 8e871c455c

View file

@ -1,4 +1,5 @@
const en = require("../src/i18n/strings/en_EN");
const de = require("../src/i18n/strings/de_DE");
module.exports = jest.fn((opts, cb) => {
const url = opts.url || opts.uri;
@ -8,9 +9,15 @@ module.exports = jest.fn((opts, cb) => {
"fileName": "en_EN.json",
"label": "English",
},
"de": {
"fileName": "de_DE.json",
"label": "German",
},
}));
} else if (url && url.endsWith("en_EN.json")) {
cb(undefined, {status: 200}, JSON.stringify(en));
} else if (url && url.endsWith("de_DE.json")) {
cb(undefined, {status: 200}, JSON.stringify(de));
} else {
cb(true, {status: 404}, "");
}