-
-
Notifications
You must be signed in to change notification settings - Fork 396
London | 26-ITP-Sep | Mandip Sanger | Sprint 3 | Implement-and-rewrire-tests #1612
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
mandipsanger
wants to merge
13
commits into
CodeYourFuture:main
Choose a base branch
from
mandipsanger:sprint-3/implement-and-rewrite-tests
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
13 commits
Select commit
Hold shift + click to select a range
f545cd3
Implement getAngleType function to determine angle types
mandipsanger 60bae09
add test to get angle
mandipsanger 3a0e465
add proper fraction test
mandipsanger 6c49020
fix errors
mandipsanger b6f832b
code implement
mandipsanger 9de9db0
get card value
mandipsanger 4472fa2
fix errors
mandipsanger 142c282
fix throw error and test
mandipsanger 7f24ec5
Merge branch 'main' into sprint-3/implement-and-rewrite-tests
mandipsanger 496fa45
Simplify rank checks for card value retrieval
mandipsanger 9409992
Implement getCardValue function logic
mandipsanger df823bd
simpyfiiying with loop
mandipsanger 07e63b8
adding loop
mandipsanger 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
39 changes: 34 additions & 5 deletions
39
Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js
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 |
|---|---|---|
| @@ -1,10 +1,39 @@ | ||
| // This statement loads the isProperFraction function you wrote in the implement directory. | ||
| // We will use the same function, but write tests for it using Jest in this file. | ||
| const isProperFraction = require("../implement/2-is-proper-fraction"); | ||
|
|
||
| // TODO: Write tests in Jest syntax to cover all combinations of positives, negatives, zeros, and other categories. | ||
| test("should return true when numerator is less than denominator", () => { | ||
| expect(isProperFraction(1, 2)).toEqual(true); | ||
| expect(isProperFraction(3, 4)).toEqual(true); | ||
| }); | ||
|
|
||
| test("should return false when numerator is greater than denominator", () => { | ||
| expect(isProperFraction(5, 2)).toEqual(false); | ||
| expect(isProperFraction(10, 3)).toEqual(false); | ||
| }); | ||
|
|
||
| test("should return false when numerator equals denominator", () => { | ||
| expect(isProperFraction(4, 4)).toEqual(false); | ||
| }); | ||
|
|
||
| test("should return true when numerator is zero and denominator is positive", () => { | ||
| expect(isProperFraction(0, 5)).toEqual(true); | ||
| }); | ||
|
|
||
| // Special case: numerator is zero | ||
| test(`should return false when denominator is zero`, () => { | ||
| test("should return false when denominator is zero", () => { | ||
| expect(isProperFraction(1, 0)).toEqual(false); | ||
| }); | ||
|
|
||
| test("should return false when numerator and denominator are zero", () => { | ||
| expect(isProperFraction(0, 0)).toEqual(false); | ||
| }); | ||
|
|
||
| test("should return true when numerator is negative and denominator is positive", () => { | ||
| expect(isProperFraction(-1, 6)).toEqual(true); | ||
| }); | ||
|
|
||
| test("should return false when denominator is negative", () => { | ||
| expect(isProperFraction(1, -5)).toEqual(false); | ||
| }); | ||
|
|
||
| test("should return false when both numerator and denominator are negative", () => { | ||
| expect(isProperFraction(-4, -5)).toEqual(false); | ||
| }); | ||
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.
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.
Uh oh!
There was an error while loading. Please reload this page.