Fix german i18n test which was previously broken due to async

pull/21833/head
Michael Telatynski 2020-09-15 13:24:20 +01:00
parent 608249745a
commit 8e871c455c
1 changed files with 7 additions and 0 deletions

View File

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