From 89a351a0d156950071cc144a125f390f2ec038cd Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Thu, 6 Aug 2015 08:58:58 -0500 Subject: [PATCH] Add check for if string exists --- test/transifex/malformedStrings.test.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/transifex/malformedStrings.test.js b/test/transifex/malformedStrings.test.js index cd751cd752..11a41c88a9 100644 --- a/test/transifex/malformedStrings.test.js +++ b/test/transifex/malformedStrings.test.js @@ -29,10 +29,16 @@ _(languages).each(function(lang) { var englishString = parsedEnglishFile[key]; var translationString = parsedTranslationFile[key]; + it(key + ' exists in ' + file + ' for the ' + lang + ' language', function() { + expect(translationString).to.exist; + }); + + if(!translationString) return; + var EnglishOccurences = englishString.match(interpolationRegex); var TranslationOccurences = translationString.match(interpolationRegex); - xit(key + ' - contains an interpolation', function() { + it(key + ' - contains an interpolation', function() { if(!TranslationOccurences) console.log("English String:", englishString); expect(EnglishOccurences).to.exist; @@ -40,7 +46,7 @@ _(languages).each(function(lang) { }); if(EnglishOccurences.length > 1) { - it(key + ' - has the correct number of interpolations', function() { + xit(key + ' - has the correct number of interpolations', function() { if(!TranslationOccurences) console.log("English String:", englishString); var numberOfOccurences = TranslationOccurences && TranslationOccurences.length; expect(numberOfOccurences).to.eql(EnglishOccurences.length);