This repository was archived by the owner on Jan 14, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 265
london-10-shadi-fakhri-core-2-coursework-week1 #235
Open
Shadi38
wants to merge
1
commit into
CodeYourFuture:main
Choose a base branch
from
Shadi38:main
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
| For this exercise, the function has been written for you and you need to write | ||
| the tests. | ||
|
|
||
| This function takes a trainee parameter that is an object. The object | ||
|
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. Tests are all ok but read this again and check the function convertScoreToGrade() again. |
||
| This function takes a that is an object. The object | ||
| contains: name (which represents the trainee's name) and score (which | ||
| represents the mark given to the trainee's coursework). | ||
|
|
||
|
|
@@ -55,15 +55,31 @@ function formatCourseworkResult(trainee) { | |
| score: 63 | ||
| } | ||
| */ | ||
|
|
||
| test("a score of 63 is grade C", () => { | ||
| const trainee = { | ||
| name: "Xin", | ||
| score: 63 | ||
| }; | ||
| expect(formatCourseworkResult(trainee)).toEqual( | ||
| "Xin's coursework was marked as grade C." | ||
| ); | ||
| }); | ||
| /* | ||
| Write a test that checks the output of formatCourseworkResult when passed the following trainee: | ||
| { | ||
| name: "Mona", | ||
| score: 78 | ||
| } | ||
| */ | ||
|
|
||
| test("a score of 78 is grade B", () => { | ||
| const trainee = { | ||
| name: "Mona", | ||
| score: 78 | ||
| }; | ||
| expect(formatCourseworkResult(trainee)).toEqual( | ||
| "Mona's coursework was marked as grade B." | ||
| ); | ||
| }); | ||
| /* | ||
| Write a test that checks the output of formatCourseworkResult when passed the following trainee: | ||
| { | ||
|
|
@@ -73,19 +89,47 @@ function formatCourseworkResult(trainee) { | |
| subjects: ["JavaScript", "React", "CSS"] | ||
| } | ||
| */ | ||
| test("the score of Ali is E", () => { | ||
| const trainee = { | ||
| name: "Ali", | ||
| score: 49, | ||
| age: 33, | ||
| subjects: ["JavaScript", "React", "CSS"] | ||
| }; | ||
|
|
||
| expect(formatCourseworkResult(trainee)).toEqual( | ||
| "Ali's coursework was marked as grade E." | ||
| ); | ||
| }); | ||
| /* | ||
| Write a test that checks the output of formatCourseworkResult when passed the following trainee: | ||
| { | ||
| score: 90, | ||
| age: 29 | ||
| } | ||
| */ | ||
| test("there is no name ", () => { | ||
| let trainee = { | ||
| score: 90, | ||
| age: 29, | ||
| }; | ||
|
|
||
| expect(formatCourseworkResult(trainee)).toEqual("Error: No trainee name!"); | ||
| }); | ||
| /* | ||
| Write a test that checks the output of formatCourseworkResult when passed the following trainee: | ||
| { | ||
| name: "Aman", | ||
| subjects: ["HTML", "CSS", "Databases"] | ||
| } | ||
| */ | ||
| test("there is no score", () => { | ||
| let trainee = { | ||
| name: "Aman", | ||
| subjects: ["HTML", "CSS", "Databases"], | ||
| }; | ||
|
|
||
| expect(formatCourseworkResult(trainee)).toEqual( | ||
| "Error: Coursework percent is not a number!" | ||
| ); | ||
| }); | ||
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.
Check what would happen to 'newObject' if you call createLookup() twice.