From bf28ffaee893ead6eba1b874359bd1b9f845a92c Mon Sep 17 00:00:00 2001 From: CalvinRodo Date: Sat, 25 May 2019 23:52:54 -0400 Subject: [PATCH] Formatting test --- tests/unit/i18n.spec.ts | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/tests/unit/i18n.spec.ts b/tests/unit/i18n.spec.ts index 5ae70a28..d3adc874 100644 --- a/tests/unit/i18n.spec.ts +++ b/tests/unit/i18n.spec.ts @@ -1,4 +1,3 @@ - import en from "@/plugins/en.json"; import fr from "@/plugins/fr.json"; import _ from "lodash"; @@ -9,19 +8,19 @@ const frKeys = Object.keys(fr); describe("i18n", () => { it("should have identical keys", () => { const val = _.difference(enKeys, frKeys); - const enIntersection = _.intersection(enKeys, val); - const mek = enIntersection.join("\n") - const frIntersection = _.intersection(frKeys, val); - const mfk = frIntersection.join("\n"); - - console.log(` -extra keys in en.json -${mek} -extra keys in fr.json -${mfk}`); - + if (val.length > 0) { + + const mek = _.intersection(enKeys, val) + .join("\n"); + + const mfk = _.intersection(frKeys, val) + .join("\n"); + + console.log( + `extra keys in en.json\n ${mek} extra keys in fr.json\n ${mfk}` + ); + } + expect(Object.keys(val).length).toBe(0); }); - - });