-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#11 Add tests for i18n-lang-js technology #18
Conversation
…r enb-diverse-js module
@@ -1 +1,3 @@ | |||
.idea |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
может лучше это добавить в свой глобальный .gitignore
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Да, такое нужно уносить в свой ~/.gitignore
.
@@ -34,6 +34,7 @@ | |||
}, | |||
"devDependencies": { | |||
"enb": ">= 0.11.0 < 1.0.0", | |||
"istanbul": "0.3.14", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
пакеты ниже можно сразу обновить
Нужно добавить тест на случай, когда файл с кейсетами пустой. |
"Нужно добавить тест на случай, когда файл с кейсетами пустой."
|
Да
module.exports = {};
Что-то в таком духе: if (typeof BEM !== \'undefined\' && BEM.I18N) {
BEM.I18N.lang(\'' + lang + '\');
} |
Я исправил все замечания по этому pr. |
ну если тебе не по душе унести схему, то у меня других заметок нет. Кстати, посмотри, плз, мой комментарий - ты на него не ответил. |
кмк, пустой-пустой тоже может иметь смысл проверять, например, если файл с переводами закомментировали: // module.exports = {
//
// } |
}) | ||
} | ||
}, | ||
expected = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
у тебя в двух тестах этот массив отличается только одним айтемом - ' "key": \'val2\''
. Его можно перенести в buildWithCache
, а в функцию уже передавать параметром expected
что ты ожидаешь получить - 'val1'
или 'val2'
. Мне кажется, что станет красивее :) (имхо)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Сделал как ты сказал
"кмк, пустой-пустой тоже может иметь смысл проверять, например, если файл с переводами закомментировали:" - этот файл получается в результате работы предыдущей технологии i18n-merge-keysets.js и является автогенеренным. Сложно представить что его могули закомментировать |
@tormozz48 во, вот последний коммит прям красивый :)
но если считаешь, что это нечитабельно, то можно забить |
в общем, у меня всё :) |
@sipayRT
|
@tormozz48 вот я об этом и говорю - не понятно что в этом большом куске кода должно поменяться. А переменные хоть подсветятся :) Но я не настаиваю, можно и так оставить |
#11 Add tests for i18n-lang-js technology
Please review it
@blond @sipayRT