Repository navigation
London | 26-ITP-Sep| Abdennour Hachemi | Sprint 2 | Implement-and-rewrite-tests #1761
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
base: main
Are you sure you want to change the base?
Changes from all commits
83be2bc
5b0e166
bb24c34
0cabd79
9115524
7c634be
98b79a3
c438ca5
23023fd
3f1f7c2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
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. Solid tests! Have you noticed a couple of minor typos in the descriptions, and might negative numbers be worth covering? |
|
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. Great test coverage for valid cards and invalid formats! How might the function handle lowercase inputs or missing values? |
|
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. Solid implementation! What happens if a negative number is passed into the function? |
|
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. Solid implementation! How does the function handle negative numbers, and should they be considered proper fractions in this context? |
|
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. Clean regex logic! Notice where the function's closing brace is placed—is all of that implementation code currently inside the function body? |
|
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. Great coverage of the angle types! Have you checked the syntax of the first test block—is anything missing at the end before the next test starts? |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,30 @@ | ||
| import { getAngleType } from "../implement/1-get-angle-type.js"; | ||
|
|
||
| // TODO: Write tests in Jest syntax to cover all cases/outcomes, | ||
| // including boundary and invalid cases. | ||
|
|
||
| // Case 1: Acute angles | ||
| test(`should return "Acute angle" when (0 < angle < 90)`, () => { | ||
| // Test various acute angles, including boundary cases | ||
| expect(getAngleType(1)).toEqual("Acute angle"); | ||
| expect(getAngleType(45)).toEqual("Acute angle"); | ||
| expect(getAngleType(89)).toEqual("Acute angle"); | ||
|
|
||
|
|
||
|
|
||
| test("Classifies right angles", () => { | ||
| expect(getAngleType(90)).toBe("Right angle"); | ||
| }); | ||
|
|
||
| test("Classifies acute angles", () => { | ||
| expect(getAngleType(60)).toBe("Acute angle"); | ||
| }); | ||
|
|
||
| test("Classifies obtuse angles", () => { | ||
| expect(getAngleType(120)).toBe("Obtuse angle"); | ||
| }); | ||
|
|
||
| // Case 2: Right angle | ||
| // Case 3: Obtuse angles | ||
| // Case 4: Straight angle | ||
| // Case 5: Reflex angles | ||
| // Case 6: Invalid angles | ||
| test("Classifies straight angles", () => { | ||
| expect(getAngleType(180)).toBe("Straight angle"); | ||
| }); | ||
|
|
||
| test("Classifies reflex angles", () => { | ||
| expect(getAngleType(350)).toBe("Reflex angle"); | ||
| }); | ||
|
|
||
| test("Classifies invalid angles", () => { | ||
| expect(getAngleType(370)).toBe("Invalid 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. Nice test coverage! Have you noticed the duplicated test blocks throughout the file |
|
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. Comprehensive and thorough test suite covering numbers, face cards, and multiple error formats! Have you considered whether testing the Ace card is also needed in this block? |
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.
Thanks for sharing your tests! You’ve set up a solid foundation covering the main angle categories.
Are there any boundary values or edge cases (such as 0°, 360°, or negative numbers) that might be worth including to ensure the function handles all possible inputs precisely?