-
-
Notifications
You must be signed in to change notification settings - Fork 219
CYF-ITP-South Africa | Serna Malala| Module-Structuring-and-Testing-Data | Week 3 #198
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
Conversation
…tion to return the correct descriptions
…t fiile to track the different cases
…emove my console.log tests when running the tests. I did that and I did not get any more errors
…and was able to implement a working solution
…and was able to implement a working solution
…to give some more unique tests like usinng the numbers within strings
…y test code into GPT without changing it to give me better descriptions for the test cases'
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 left comments and suggestions in the code.
Regarding your question, "Regarding commenting in the test function, how descriptive should they be?" Write it in such a way that
I personally prefer concise description. Complete sentence is not needed. |
…ming and I also removed redundant conditions set in the if else statement
Hi @cjyuan I've looked at your review comments and I've adjusted those that I could. I left some questions for the comments I found a bit more difficult to understand. |
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.
Instead of using multiple if/else consider using switch statements
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.
Hi @KudahShambare I am only seeing your review now. I already responded to CJ's review
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.
How are you handling the equal denominator and equal numerator scenario?
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.
Is it passing all the tests?
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.
when arranging your code in if statements, consider following either an ascending/descending (depending with the situation) pattern. In this case you are starting with 0, then negative numbers then finally positive numbers. This order of your statements affects how the code is executed. For example if num is -7, firstly its going to compare if its equal to 0 and then continues to check if it's less than 0 (Here it will throw an error. If we swap the conditions it will just throw an error without even running the equality test -- saving time)
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://stackoverflow.com/questions/62150130/algorithm-of-checking-if-the-number-is-prime
Refer to the discussion in the link above. For large numbers, your implementation of the algorithm will be very slow.
Learners, PR Template
Self checklist
Changelist
Briefly explain your PR.
I have completed all the exercises, I have implemented functions as required according to the conditions given and I have also created test files for these functions by using Jest.
Questions
Regarding commenting in the test function, how descriptive should they be?
Ask any questions you have for your reviewer.