mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-13 15:38:59 +00:00
Add check for if string exists
This commit is contained in:
parent
1f6cad7baf
commit
89a351a0d1
1 changed files with 8 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue