From 534736ea5860c5cbb10c017985468b2553fc9ce3 Mon Sep 17 00:00:00 2001
From: AkiraFukushima
Date: Mon, 18 Nov 2019 22:36:19 +0900
Subject: [PATCH] refs #1106 Remove unsued spec which checks perfection of
translation
---
spec/config/i18n.spec.ts | 25 +------------------------
1 file changed, 1 insertion(+), 24 deletions(-)
diff --git a/spec/config/i18n.spec.ts b/spec/config/i18n.spec.ts
index 2fbc0007..908724cf 100644
--- a/spec/config/i18n.spec.ts
+++ b/spec/config/i18n.spec.ts
@@ -1,40 +1,17 @@
import * as path from 'path'
import fs from 'fs'
import keys from 'all-object-keys'
-import objectAssignDeep from 'object-assign-deep'
-const defaultLocale = 'en'
const locales = ['de', 'fr', 'it', 'ja', 'ko', 'pl', 'zh_cn']
-const enJson = JSON.parse(fs.readFileSync(path.resolve(__dirname, `../../src/config/locales/${defaultLocale}/translation.json`), 'utf8'))
-
describe('i18n', () => {
- describe('should be same keys', () => {
- locales.map(locale => {
- it(`${locale} translation`, () => {
- const targetJson = JSON.parse(
- fs.readFileSync(path.resolve(__dirname, `../../src/config/locales/${locale}/translation.json`), 'utf8')
- )
- const targetMissingJson = JSON.parse(
- fs.readFileSync(path.resolve(__dirname, `../../src/config/locales/${locale}/translation.missing.json`), 'utf8')
- )
- const enKeys = keys(enJson)
- const targetKeys = keys(objectAssignDeep(targetJson, targetMissingJson))
- expect(enKeys.sort()).toEqual(targetKeys.sort())
- })
- })
- })
-
describe('should not define duplicate keys', () => {
locales.map(locale => {
it(`${locale} translation`, () => {
const targetJson = JSON.parse(
fs.readFileSync(path.resolve(__dirname, `../../src/config/locales/${locale}/translation.json`), 'utf8')
)
- const targetMissingJson = JSON.parse(
- fs.readFileSync(path.resolve(__dirname, `../../src/config/locales/${locale}/translation.missing.json`), 'utf8')
- )
- const allKeys = keys(targetJson).concat(keys(targetMissingJson))
+ const allKeys = keys(targetJson)
const duplicates: Array = allKeys.filter(
(x: string, _: number, self: Array) => self.indexOf(x) !== self.lastIndexOf(x)
)