-
Notifications
You must be signed in to change notification settings - Fork 94
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
Module-1-2 task solutions #57
base: master
Are you sure you want to change the base?
Conversation
@@ -22,7 +22,30 @@ function grade(score) { | |||
*/ | |||
// PLACE YOUR CODE BETWEEN THIS... | |||
|
|||
// ...AND THIS COMMENT LINE! | |||
|
|||
if (score < 0 || score > 100) { |
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.
The solution seems to be ok but I still would suggest digesting the functions of Math, especially the Math.ceil()
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.
Solution was reworked using Math.ceil()
and Math.max()
functions.
|
||
// ...AND THIS COMMENT LINE! | ||
if (n < 2) { |
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.
Could you please remove the unnecessary, empty lines?
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.
Unnecessary empty lines were removed.
module-2/test/calc.spec.js
Outdated
//When | ||
//Then | ||
expect(() => c.divide(0)).to.throw("Division"); |
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.
I think you can check the exact error message as it is a static one. "Division by 0 is not possible!"
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.
Checking of exact error message was implemented.
module-2/test/calc.spec.js
Outdated
//When | ||
//Then | ||
expect(() => c.sqrt()).to.throw("Square"); |
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.
Could you please dig into the source and check if the validation of the exact message is possible?
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.
Checking of exact error message was implemented.
module-2/test/calc.spec.js
Outdated
|
||
}); | ||
|
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.
Could you please remove the unnecessary empty lines?
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.
Unnecessary empty lines were removed.
…le-2/test/calc-spec.js based on Sandor Orosz's comments
Please review my solution for Module-1 task:
Please review my solution for Module-2 task: