Repository navigation
London | 26-ITP-Sep | Alan Mak | Sprint 2 | Implement and rewrite tests #1695
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
Open
AlanGit-debug2604
wants to merge
18
commits into
CodeYourFuture:main
Choose a base branch
from
AlanGit-debug2604:Sprint2-Coursework
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
bfd3913
1-get-angle-type Comment out pseudo code Give-when-then
1f731d2
2-is-proper-fraction Add comments to clarify the isProperFraction fu…
4ef98cd
3-get-card-value.js Add comments to clarify the isProperFraction func…
c44e20a
Implement getAngleType function to determine angle types based on inp…
06782aa
2-is-proper-fraction.js implement the function isProperFraction, adde…
b405180
1-get-angle-type.js fixed typo for test
AlanGit-debug2604 327decd
1-get-angle-type.test.js write 9 additional test cases. Ran tests.
AlanGit-debug2604 88a6000
3-get-card-value.js added implementation code, define string as input…
AlanGit-debug2604 401ad2b
2-is-proper-fraction.test wrote 8 additional test cases: equal , impr…
AlanGit-debug2604 acfaabd
2-is-proper-fraction edited denominator=0 to correct exception for …
AlanGit-debug2604 a963f0f
3-getCardValue function to provide specific error messages for invali…
AlanGit-debug2604 19d4b52
Add tests for invalid rank and suit inputs in getCardValue function
AlanGit-debug2604 52e4cd1
Refactor getCardValue function to improve error handling for invalid …
3064fb8
Tests for getCardValue function to improve clarity and error messagin…
8edda76
test: rewrite getAngleType tests with Jest
af9a958
2-is-proper-fraction jest test: expand isProperFraction tests to cove…
AlanGit-debug2604 77f89cc
3-get-card-value write jest tests to cover additional edge cases and…
AlanGit-debug2604 01e3987
2-is-proper-fraction jest test: numbering cases in comment for easy c…
AlanGit-debug2604 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,4 +18,33 @@ | |
|
|
||
| export function getAngleType(angle) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What would this function return for 360 and 0 degree angles? |
||
| // TODO: Implement this function | ||
|
|
||
| if (angle < 0 || angle > 360) { | ||
| return `Invalid angle`; | ||
| } | ||
| if (angle < 90) { | ||
| return `Acute angle`; | ||
| } | ||
| if (angle == 90) { | ||
| return `Right angle`; | ||
| } | ||
| if (angle === 180) { | ||
| return `Straight angle`; | ||
| } | ||
| if (angle < 180) { | ||
| return `Obtuse angle`; | ||
| } | ||
| return `Reflex angle`; | ||
| } | ||
|
|
||
| //Pseudo codes | ||
| //First define type: Num (whole number) | ||
| //Then range: 0 - 360 | ||
| //Cases: | ||
| //1. 0-89 : Actute angle | ||
| //2. 90 : Right angle | ||
| //3. 91-179: Obtuse angle | ||
| //4. 180: Straight angle | ||
| //5. 181-359 : Reflex angle | ||
| //6. 360 and beyond Invalid angle | ||
| //Key word to use : If? | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 remove this test on purpose?