diff options
Diffstat (limited to 'test/i18n.test.ts')
-rw-r--r-- | test/i18n.test.ts | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/i18n.test.ts b/test/i18n.test.ts index 61a4963..913054e 100644 --- a/test/i18n.test.ts +++ b/test/i18n.test.ts @@ -1,5 +1,5 @@ -const en = require("../app/i18n/en.json") -const { exec } = require("child_process") +const en = require('../app/i18n/en.json') +const { exec } = require('child_process') // Use this array for keys that for whatever reason aren't greppable so they // don't hold your test suite hostage by always failing. @@ -10,7 +10,7 @@ const EXCEPTIONS = [ function iterate(obj, stack, array) { for (const property in obj) { if (Object.prototype.hasOwnProperty.call(obj, property)) { - if (typeof obj[property] === "object") { + if (typeof obj[property] === 'object') { iterate(obj[property], `${stack}.${property}`, array) } else { array.push(`${stack.slice(1)}.${property}`) @@ -40,14 +40,14 @@ function iterate(obj, stack, array) { * */ -describe("i18n", () => { - test("There are no missing keys", (done) => { +describe('i18n', () => { + test('There are no missing keys', (done) => { // Actual command output: // grep "Tx=\"\S*\"\|tx=\"\S*\"\|translate(\"\S*\"" -ohr './app' | grep -o "\".*\"" const command = `grep "Tx=\\"\\S*\\"\\|tx=\\"\\S*\\"\\|translate(\\"\\S*\\"" -ohr './app' | grep -o "\\".*\\""` exec(command, (_, stdout) => { - const allTranslationsDefined = iterate(en, "", []) - const allTranslationsUsed = stdout.replace(/"/g, "").split("\n") + const allTranslationsDefined = iterate(en, '', []) + const allTranslationsUsed = stdout.replace(/"/g, '').split('\n') allTranslationsUsed.splice(-1, 1) for (let i = 0; i < allTranslationsUsed.length; i += 1) { |