-
-
Notifications
You must be signed in to change notification settings - Fork 337
Manchester | 26-ITP-Jan | khalidbih | Sprint 3 | coursework/sprint-3-implement-and-rewrite #1270
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
6998ca1
29b6533
29da7a4
2973a05
8a0a7c3
f0b9120
4483f93
05dc806
a01738f
d3eb33d
57c5bab
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 |
|---|---|---|
|
|
@@ -8,3 +8,21 @@ const isProperFraction = require("../implement/2-is-proper-fraction"); | |
| test(`should return false when denominator is zero`, () => { | ||
| expect(isProperFraction(1, 0)).toEqual(false); | ||
| }); | ||
| test("should return false when numerator is greater than denominator", () => { | ||
| expect(isProperFraction(5, 2)).toEqual(false); | ||
| }); | ||
| test("should return true when |numerator| < |denominator|", () => { | ||
| expect(isProperFraction(-4, 7)).toEqual(true); | ||
| }); | ||
| test("should return false when numerator equals denominator", () => { | ||
| expect(isProperFraction(3, 3)).toEqual(false); | ||
| }); | ||
| test("should return true when numerator < denominator and denominator is negative", () => { | ||
| expect(isProperFraction(4, -7)).toEqual(true); | ||
| }); | ||
| test("should return true when numerator and denominator are both negative and numerator < denominator", () => { | ||
| expect(isProperFraction(-4, -7)).toEqual(true); | ||
| }); | ||
|
Comment on lines
+20
to
+25
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. Could also use the absolute value notation on these descriptions. In math, 4 is larger than -7, and -4 is larger than -7. The absolute value notation could help make the description concise.
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 suggestion, I’ll keep this in mind for future tests. |
||
| test("should return true when numerator is zero and denominator is negative", () => { | ||
| expect(isProperFraction(0, -5)).toEqual(true); | ||
| }); | ||
Uh oh!
There was an error while loading. Please reload this page.