From 1456aeedf2b29a7eb7a244ec5caccb0b531ade0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Ram=C3=ADrez=20Norambuena?= Date: Mon, 28 Aug 2017 21:30:36 -0300 Subject: [PATCH] TestSuite: Show the missing strings for translations files. In the translations test now when are missing some translations for determinated language will be show the missing string. This can help to identified and improved the translations files. /me listening STP: Silvergun superman --- package.json | 1 + tests/unit/translations/same_keys.js | 3 +++ 2 files changed, 4 insertions(+) diff --git a/package.json b/package.json index 1fb21a9d..26f26b8f 100644 --- a/package.json +++ b/package.json @@ -59,6 +59,7 @@ "feedme": "latest", "helmet": "^3.6.1", "iconv-lite": "latest", + "mocha-logger": "^1.0.5", "moment": "latest", "request": "^2.81.0", "rrule-alt": "^2.2.5", diff --git a/tests/unit/translations/same_keys.js b/tests/unit/translations/same_keys.js index 67ed7170..9511a60f 100644 --- a/tests/unit/translations/same_keys.js +++ b/tests/unit/translations/same_keys.js @@ -2,6 +2,7 @@ var fs = require("fs"); var path = require("path"); var chai = require("chai"); var expect = chai.expect; +var mlog = require("mocha-logger"); describe("Translations have the same keys as en.js", function() { var translations = require("../../../translations/translations.js"); @@ -31,6 +32,8 @@ describe("Translations have the same keys as en.js", function() { expect(fileKeys).to.deep.equal(baseKeys); } catch(e) { if (e instanceof chai.AssertionError) { + diff = baseKeys.filter(function(x) { return fileKeys.indexOf(x) < 0 }); + mlog.pending("Missing Translations for language " + tr + ": ", diff); test.skip(); } else { throw e;