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); }); - - });