-
-
Notifications
You must be signed in to change notification settings - Fork 245
Manchester | 25-ITP-Sep | Khalidbih | Sprint 3 | coursework/sprint-3-implement-and-rewrite #879
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
0bd35d1
e2c27cd
6557f26
7ffe0a6
92cbdf6
8930945
356b64f
67710d6
498d7ae
147fcbb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,7 +7,16 @@ test("should return true for a proper fraction", () => { | |
| }); | ||
|
|
||
| // Case 2: Identify Improper Fractions: | ||
| test("should return false for Improper fraction", () => { | ||
| expect(isProperFraction(5, 2)).toEqual(false); | ||
| }); | ||
|
|
||
| // Case 3: Identify Negative Fractions: | ||
| test("should return true for Negative fraction", () => { | ||
| expect(isProperFraction(-4, 7)).toEqual(true); | ||
| }); | ||
|
Comment on lines
+15
to
+17
Contributor
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. The test description is still not quite correct.
Author
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. Thank you for the feedback. I’ll make sure to write clearer test descriptions next time and pay more attention. |
||
|
|
||
| // Case 4: Identify Equal Numerator and Denominator: | ||
| test("should return false for Equal numerator and denominator", () => { | ||
| expect(isProperFraction(3, 3)).toEqual(false); | ||
| }); | ||
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 your function pass all the tests in this script?
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.
No, because it will fail the negative fraction test (Case 3).
I run the code, this is the output: FAIL ../1-implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js
✓ should return true for a proper fraction (4 ms)
✓ should return false for Improper fraction (4 ms)
✕ should return false for Negative fraction (2 ms)
✓ should return false for Equal numerator and denominator (1 ms)
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.
One test fails. So how would you fix the issue?
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 updated the test so that negative fractions are handled correctly, and after running the tests with Jest, everything passed.