Merge branch '046-test-that-localization-files-have-same-keys' into 'master'

Add test that english and german localization files have same keys

Closes #46

See merge request dungeonslayers/ds4!46
This commit is contained in:
Johannes Loher 2021-01-10 17:06:06 +01:00
commit bd2311cce0
3 changed files with 31 additions and 0 deletions

15
package-lock.json generated
View file

@ -110,6 +110,15 @@
"fastq": "^1.6.0"
}
},
"@types/fs-extra": {
"version": "9.0.6",
"resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.6.tgz",
"integrity": "sha512-ecNRHw4clCkowNOBJH1e77nvbPxHYnWIXMv1IAoG/9+MYGkgoyr3Ppxr7XYFNL41V422EDhyV4/4SSK8L2mlig==",
"dev": true,
"requires": {
"@types/node": "*"
}
},
"@types/jasmine": {
"version": "3.6.2",
"resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-3.6.2.tgz",
@ -131,6 +140,12 @@
"integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==",
"dev": true
},
"@types/node": {
"version": "14.14.20",
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.20.tgz",
"integrity": "sha512-Y93R97Ouif9JEOWPIUyU+eyIdyRqQR0I8Ez1dzku4hDx34NWh4HbtIc3WNzwB1Y9ULvNGeu5B8h8bVL5cAk4/A==",
"dev": true
},
"@types/parse-json": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz",

View file

@ -40,6 +40,7 @@
"format": "prettier --write 'src/**/*.(ts|json|scss)'"
},
"devDependencies": {
"@types/fs-extra": "^9.0.6",
"@types/jasmine": "^3.6.2",
"@typescript-eslint/eslint-plugin": "^4.11.1",
"@typescript-eslint/parser": "^4.11.1",

View file

@ -0,0 +1,15 @@
import "jasmine";
import * as fs from "fs-extra";
import * as path from "path";
describe("English and german localization files", () => {
const localizationPath = "./src/lang/";
const en: Record<string, unknown> = fs.readJSONSync(path.join(localizationPath, "en.json"));
const de: Record<string, unknown> = fs.readJSONSync(path.join(localizationPath, "de.json"));
it("should have the same keys.", () => {
const deKeys = Object.keys(de);
const enKeys = Object.keys(en);
expect(deKeys).toEqual(enKeys);
});
});