-
-
Notifications
You must be signed in to change notification settings - Fork 241
London_Jan25| Sabita_Shrestha| Module-Structuring-and-Testing-Data| Sprint 3| Week 6 #337
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
London_Jan25| Sabita_Shrestha| Module-Structuring-and-Testing-Data| Sprint 3| Week 6 #337
Conversation
suziebrown
left a comment
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.
Looking good 👍
I've just left a few small suggestions where things could be improved
| // This should produce the string "CKJ", but you must not write the characters C, K, or J in the code of your solution. | ||
|
|
||
| let initials = ``; | ||
| let initials = firstName.charAt(0) + middleName.charAt(0) + lastName.charAt(0); |
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.
Great 👍
You can also use e.g. firstName[0] instead of firstName.charAt(0) - either option is fine.
| const twentyFourHourClockTime = "08:53"; | ||
| console.log(twelveHourClockTime); | ||
| console.log(twentyFourHourClockTime); | ||
| //it says syntax error because variable should start with letter or underscore. |
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.
Well spotted. Can you see any other mistake in the code?
|
|
||
| // a) How many function calls are there in this file? Write down all the lines where a function call is made | ||
| //ans- There are 5 function calls: | ||
| //carPrice = Number(carPrice.replaceAll(",", "")); |
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.
You're right, but can you make the explanation clearer? Which lines are the function calls on and which are the functions being called?
| // remainingSEcond = movieLength % 60 | ||
|
|
||
| // e) What do you think the variable result represents? Can you think of a better name for this variable? | ||
| // anns: Better name for this variable will be "formattedMovieDuration" because it is more descriptive, clearly indicating that the value is a formatted string representing the movie's duration. |
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.
Good choice of name 👍
| const totalHours = (totalMinutes - remainingMinutes) / 60; | ||
| const timeString = `${totalHours}:${remainingMinutes}:${remainingSeconds}`; | ||
| console.log(timeString); | ||
| // It does work with another value as i change the movie length, it does work. |
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.
Did you try with any other values? Can you think of any edge cases where the formatting might not work correctly?
| // When the function is called with such a card, | ||
| // Then it should throw an error indicating "Invalid card rank." | ||
| const invalidCards =getCardValue("Invalid") | ||
| assertEquals(invalidCards, "Invalid card" ) |
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 some of the test cases are not passing yet. See if you can change the code to work in all scenarios
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 can see you got all the cases working in the later exercise - well done
| expect(getAngleType(180)).toEqual("Straight angle"); | ||
| }); | ||
|
|
||
| test("should identify reflex angle (90°)", () => { |
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.
Remember to check that each test name accurately describes the test case. It's easy to make mistakes when writing several similar tests!
|
|
||
| // Case 4: Handle Ace (A): | ||
| test("should return 11 for ace card",()=>{ | ||
| const cardA =getCardValue("A"); |
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.
Make sure the input used in the test is in the same format as in the instructions
| // And a character char that does not exist within the case-sensitive str, | ||
| // When the function is called with these inputs, | ||
| // Then it should return 0, indicating that no occurrences of the char were found in the case-sensitive str. | ||
| test("should return 0 for the case-sensitive str ",()=>{ |
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.
Can you improve the name of this test at all? Under what circumstances should 0 be returned?
| test("should return '4th' for 4", () => { | ||
| expect(getOrdinalNumber(4)).toEqual("4th"); | ||
| }); | ||
|
|
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.
Can you think of any other cases that should be tested?
Thank you for your review. I really appreciate and I will improved area as you mention me. |
I have made changes as you mentioned. Thank you. |
Learners, PR Template
Self checklist
Changelist
Briefly explain your PR.
Questions
Ask any questions you have for your reviewer.