-
Notifications
You must be signed in to change notification settings - Fork 9
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
Дз4 #7
base: master
Are you sure you want to change the base?
Дз4 #7
Conversation
Создан конструктор + методы для абстрактного объекта model Класс Event унаследовался от Model Написаны тесты на 1 и 2 пункт
1. добавлены новые тесты, выделены в отделный каталог 2. создан конструктор + фильтр + фции для коллекции
1. допилен 4 пункт 2. остался jslint + jsdoc
return this.coming() | ||
.filter(function (events) { | ||
return events.start < now; | ||
}); |
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.
Вот так более читаемо
var result = this.coming()
.filter(function (events) {
return events.start < now;
});
return result;
про форматирование отписал |
в коллекции Events, когда вызывается, например фция Events.prototype.byEndTime = function () {
}; идет вызов функции sort, которая возвращает объект типа Collection, это ведь не верно? должно Events возвращать? |
Да, должно возвращать инстанс текущего конструктора. Можешь где-нибудь в прототипе сохранить ссылку "на себя" ( |
@@ -0,0 +1,81 @@ | |||
((function (exports) { |
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.
Лишняя (
скобка.
Последний коммит все испортил. Я более чем уверен, что у тебя ничего не работает ;-) |
меня опечалило, что фции возвращают совсем не то, что надо и я даже тесты не прогнала. позор мне) |
Вот так и познается вся мощь автоматических юнит-тестов! |
Если интересно попробуй начать использовать Qunit PhantomJS Runner https://github.com/jquery/qunit/tree/master/addons/phantomjs с TravisCI ;-) |
Только мне кажется, с фуункциями sort для коллекций я полный хардкор устроила... может как-то по-аккуратнее можно?