generated from CodeYourFuture/Module-Template
-
-
Notifications
You must be signed in to change notification settings - Fork 195
London | Emmanuel Gessessew | Module-Structuring-and-Testing-Data | sprint 3| WEEK 3 #185
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
Emmanuelgessessew
wants to merge
18
commits into
CodeYourFuture:main
Choose a base branch
from
Emmanuelgessessew:sprint-3
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 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
46cc0f6
solution to exercise
Emmanuelgessessew cefeea6
editing
Emmanuelgessessew 7b970c1
solving errors
Emmanuelgessessew 2500cf3
interpret exercise
Emmanuelgessessew 3ca4eca
debugging
Emmanuelgessessew 9fdeb38
correcting errors
Emmanuelgessessew cf6eacf
implement solutions
Emmanuelgessessew e1421fd
interpret solutions
Emmanuelgessessew 412c625
editting
Emmanuelgessessew cbc5c15
implementing the getAngleType
Emmanuelgessessew 89df819
implementing is proper function
Emmanuelgessessew 9370614
implementing get card value
Emmanuelgessessew 29d4ef0
changes
Emmanuelgessessew 921b6ce
implementing valid traiangle
Emmanuelgessessew 6f7180b
testing angle type
Emmanuelgessessew 0dd59e4
testing get card values
Emmanuelgessessew b3a66a4
testing propper fructions
Emmanuelgessessew 9d93d0a
changes
Emmanuelgessessew 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
test('should return "Right angle" exactly for 90 degrees', function() { | ||
mjpeet marked this conversation as resolved.
Show resolved
Hide resolved
|
||
const currentInput = getAngleType (90); | ||
const targetInput = "Right angle"; | ||
expect(currentInput).toBe(targetInput); | ||
}); | ||
|
||
test('should return "Acute angle" when degrees is less than 90 degrees', function() { | ||
const currentInput = getAngleType (45); | ||
const targetInput = "Acute angle"; | ||
expect(currentInput).toBe(targetInput); | ||
}); | ||
|
||
test('should return "Obtuse angle" when degrees are between 90 and 180 degrees', function() { | ||
const currentInput = getAngleType(135); | ||
const targetInput = "Obtuse angle"; | ||
expect(currentInput).toBe(targetInput); | ||
}); | ||
|
||
test('should return "Straight angle" exactly for 180 degrees', function() { | ||
const currentInput = getAngleType(180); | ||
const targetInput = "Straight angle"; | ||
expect(currentInput).toBe(targetInput); | ||
}); | ||
|
||
test('should return "Reflex angle" when degrees are between 180 and 360 degrees', function() { | ||
const currentInput = getAngleType(270); | ||
const targetInput = "Reflex angle"; | ||
expect(currentInput).toBe(targetInput); | ||
}); | ||
|
||
test('should return "Invalid angle" for angles less than 0 degrees', function() { | ||
const currentInput = getAngleType(-45); | ||
const targetInput = "Invalid angle"; | ||
expect(currentInput).toBe(targetInput); | ||
}); | ||
|
||
test('should return "Invalid angle" for angles equal to or greater than 360 degrees', function() { | ||
const currentInput = getAngleType(360); | ||
const targetInput = "Invalid angle"; | ||
expect(currentInput).toBe(targetInput); | ||
}); | ||
|
||
test('should return "Invalid angle" for non-numeric inputs', function() { | ||
const currentInput = getAngleType("hello"); | ||
const targetInput = "Invalid angle"; | ||
expect(currentInput).toBe(targetInput); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "week-4-test-example", | ||
"description": "An example application showing how to write tests using the jest framework", | ||
"scripts": { | ||
"test": "jest" | ||
}, | ||
"devDependencies": { | ||
"jest": "^29.5.0" | ||
} | ||
} |
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.
this test case doesn't work - can you check what happens if you use the condition angle > 90 && angle < 180 instead of 90 < angle < 180, and explain why does one work and the other doesn't?
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.
The condition 90 < angle < 180 doesn't work in JavaScript because it evaluates 90 < angle first, resulting in a boolean (true or false), which is then compared to 180. JavaScript do nott support chained comparisons like Python.