add test that english and german localization files have same keys

This commit is contained in:
Johannes Loher 2021-01-10 03:07:08 +01:00
parent 0a938bc287
commit c2ad8f7fe1
3 changed files with 31 additions and 0 deletions

15
package-lock.json generated
View file

@ -110,6 +110,15 @@
"fastq": "^1.6.0" "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": { "@types/jasmine": {
"version": "3.6.2", "version": "3.6.2",
"resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-3.6.2.tgz", "resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-3.6.2.tgz",
@ -131,6 +140,12 @@
"integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==", "integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==",
"dev": true "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": { "@types/parse-json": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", "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)'" "format": "prettier --write 'src/**/*.(ts|json|scss)'"
}, },
"devDependencies": { "devDependencies": {
"@types/fs-extra": "^9.0.6",
"@types/jasmine": "^3.6.2", "@types/jasmine": "^3.6.2",
"@typescript-eslint/eslint-plugin": "^4.11.1", "@typescript-eslint/eslint-plugin": "^4.11.1",
"@typescript-eslint/parser": "^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);
});
});