-
Notifications
You must be signed in to change notification settings - Fork 12
ITP-2025-1|Elena Vasileia|Week 6|Module-Structuring-and-Testing-Data/Sprint-3/ implement and rewrite & practice TDD #37
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
Implemented angle type identification for acute, obtuse, straight, and reflex angles. Completed the code. Tests run normally.
Updated isProperFraction function to use absolute values for proper fraction checks and added assertions for various test cases.
Refactor getCardValue function to handle card ranks and add tests for various cases including face cards and invalid cards.
…e are of my original thought)
…running the tests
…xed it back to .toEqual
| // write one test at a time, and make it pass, build your solution up methodically | ||
| // just make one change at a time -- don't rush -- programmers are deep and careful thinkers | ||
| function getCardValue(card) { | ||
| const rank = card.slice(0, -1); // Extract rank by removing the last character (emoji) |
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.
slice(0, -1) is great because it also covers card 10
MustafaBora
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.
As an answer to your comment, expect(getOrdinalNumber(1)).toBe("1st"); is more standard as far as I learned. There is more to explore on jest for sure. But this is a nice warmup for testing basics.
Sorry for the united repository, I realized when it was too late
Self checklist
Changelist
I completed and created new tests and then made my functions. My VScode has a suggestion function that helped me further (and which I don't know how I activated it neither how to deactivated it :)). Some methods like .toThrow I explored further but decided to stick with the .toEqual for now.
I have to admit that the testing part of coding (although I fully understand it's neccessity) it's not my favorite :)
Questions
Ask any questions you have for your reviewer.