-
Notifications
You must be signed in to change notification settings - Fork 83
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
codewars+mathFunc+Classes #45
base: Ivanov_Aleksej_Alekseevich
Are you sure you want to change the base?
Conversation
Укажи правильный base. Если у тебя нет ветки, отпишись, создадим |
this._color = color; | ||
} | ||
|
||
setAge(age: number){ |
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.
Геттеры и сеттеры пишутся по-другому, пожалуйста переделай корректно:
https://learn.javascript.ru/property-accessors?ysclid=m2342z978m930232161
it('Должно выкинуть ошибку при установке отрицательного возраста кролика', () => { | ||
const testRabbit2 = new Rabbit(2, 'ewrt', 'grey'); | ||
|
||
expect(() => testRabbit2.setAge(-2)).toThrow('age cant be below zero'); |
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.
Можно еще проверять на тип ошибки, просто для информации, можешь это не делать:
expect(new Rabbit(2, 'ewrt', 'grey').rejects.toBeInstanceOf(Error)
No description provided.