-
Notifications
You must be signed in to change notification settings - Fork 1
Add test for controller Consultor etc. #11
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
base: master
Are you sure you want to change the base?
Conversation
| } | ||
|
|
||
| let r = Math.floor(Math.random() * (n <= 0 ? 0 : n - 1)); | ||
| var r = Math.floor(Math.random() * (n <= 0 ? 0 : n - 1)); |
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.
для чего?
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.
выдавалась ошибка при npm start, скорее всего связано с моим локальныи окружением
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.
поставьте 6ю ноду, она поддерживает let и значения по умолчанию в функциях, а эти изменения отмените
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.
ok
|
а чего файл |
|
|
||
| User.createByVKId(usersModel, VK_USER_ID) | ||
| .then(function () { | ||
| User.getByVKId(usersModel, VK_USER_ID) |
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.
нам не нужно создавать нового пользователя, можно подставить любой произвольный id, userId = 'a12345678901' например
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.
возможно, мне нужно перепроверить, но по моему там вопросы выбираются по реальным user_id
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.
в тестовых данных нет ничего реального, тут все изолировано надо проверять
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.
я могу ошибаться, но если на вход дать фейковый id юзера, то мы не получим вопросов, выборка идёт с учётом id юзера(из users)
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.
да, точно. Это Consultor.getAllQuestions криво написан, что завязан на пользователей :(
вопрос снимается, надо будет порефакторить.
No description provided.