generated from CodeYourFuture/Module-Template
-
-
Notifications
You must be signed in to change notification settings - Fork 301
ITP_LONDON / PRISCILLA_EMEBO / Module-Structuring-and-Testing-Data / Sprint 3exercise #335
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
Closed
Conversation
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
suziebrown
approved these changes
Mar 6, 2025
suziebrown
left a comment
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.
Great work - it looks like you've understood very well about writing tests 👍
Sprint-3/3-mandatory-practice/implement/get-ordinal-number.test.js
Outdated
Show resolved
Hide resolved
Author
|
Thank you for reviewing my work. I'll make the corrections.
…On Thu, 6 Mar 2025, 20:13 Suzie Brown, ***@***.***> wrote:
***@***.**** approved this pull request.
Great work - it looks like you've understood very well about writing tests
👍
------------------------------
In Sprint-3/1-key-implement/1-get-angle-type.js
<#335 (comment)>
:
> \ No newline at end of file
+// ====> write your test here, and then add a line to pass the test in the function above
+const reflex = getAngleType(240);
+assertEquals(reflex, "Reflex angle");
Great work 👍
------------------------------
In Sprint-3/1-key-implement/3-get-card-value.js
<#335 (comment)>
:
>
// Handle Invalid Cards:
// Given a card with an invalid rank (neither a number nor a recognized face card),
// When the function is called with such a card,
// Then it should throw an error indicating "Invalid card rank."
+try {
+ getCardValue();
What about if the function is called with a made-up card like "B♥"?
------------------------------
In Sprint-3/2-mandatory-rewrite/1-get-angle-type.test.js
<#335 (comment)>
:
>
// Case 5: Identify Reflex Angles:
// When the angle is greater than 180 degrees and less than 360 degrees,
// Then the function should return "Reflex angle"
+test("should identify reflex angles (greater than 180° and less than 360°)", () => {
+ expect(getAngleType(300)).toEqual("Reflex angle");
+});
Nice 👍
------------------------------
In Sprint-3/2-mandatory-rewrite/2-is-proper-fraction.js
<#335 (comment)>
:
> \ No newline at end of file
+function isProperFraction(numerator, denominator) {
This function is declared twice now, I think you need to remove the
example declaration or replace it with yours.
------------------------------
In Sprint-3/3-mandatory-practice/implement/count.js
<#335 (comment)>
:
> @@ -1,5 +1,14 @@
-function countChar(stringOfCharacters, findCharacter) {
- return 5
+function countChar(str, char) {
+ console.log(`str: '${str}', char: '${char}', char length: ${char.length}`);
Once you've finished debugging, you can clean up the code by removing
extra console statements
------------------------------
In Sprint-3/3-mandatory-practice/implement/get-ordinal-number.test.js
<#335 (comment)>
:
> - });
+ expect(getOrdinalNumber(1)).toEqual("1st");
+});
+
+test("should return '10th' for 10", () => {
+ expect(getOrdinalNumber(10)).toEqual("10th");
+});
+test("should return '42nd' for 42", () => {
+ expect(getOrdinalNumber(42)).toBe("42nd");
+});
+
+test("should return '63rd' for 63", () => {
+ expect(getOrdinalNumber(63)).toBe("63rd");
+});
+
+test("should return '63d' for 63", () => {
I think this is a duplicate of the test above
—
Reply to this email directly, view it on GitHub
<#335 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BM6WKVE5BJPU6Y42PY5OOND2TCT6TAVCNFSM6AAAAABX37JVJCVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDMNRVGM2TMOBVHA>
.
You are receiving this because you authored the thread.Message ID:
<CodeYourFuture/Module-Structuring-and-Testing-Data/pull/335/review/2665356858
@github.com>
|
Author
|
Hello, @suziebrown I've made the corrections. Could you please review it at
your convenience.
Thank you.
…On Sat, Mar 8, 2025 at 12:42 AM Priscilla ***@***.***> wrote:
Thank you for reviewing my work. I'll make the corrections.
On Thu, 6 Mar 2025, 20:13 Suzie Brown, ***@***.***> wrote:
> ***@***.**** approved this pull request.
>
> Great work - it looks like you've understood very well about writing
> tests 👍
> ------------------------------
>
> In Sprint-3/1-key-implement/1-get-angle-type.js
> <#335 (comment)>
> :
>
> > \ No newline at end of file
> +// ====> write your test here, and then add a line to pass the test in the function above
> +const reflex = getAngleType(240);
> +assertEquals(reflex, "Reflex angle");
>
> Great work 👍
> ------------------------------
>
> In Sprint-3/1-key-implement/3-get-card-value.js
> <#335 (comment)>
> :
>
> >
> // Handle Invalid Cards:
> // Given a card with an invalid rank (neither a number nor a recognized face card),
> // When the function is called with such a card,
> // Then it should throw an error indicating "Invalid card rank."
> +try {
> + getCardValue();
>
> What about if the function is called with a made-up card like "B♥"?
> ------------------------------
>
> In Sprint-3/2-mandatory-rewrite/1-get-angle-type.test.js
> <#335 (comment)>
> :
>
> >
> // Case 5: Identify Reflex Angles:
> // When the angle is greater than 180 degrees and less than 360 degrees,
> // Then the function should return "Reflex angle"
> +test("should identify reflex angles (greater than 180° and less than 360°)", () => {
> + expect(getAngleType(300)).toEqual("Reflex angle");
> +});
>
> Nice 👍
> ------------------------------
>
> In Sprint-3/2-mandatory-rewrite/2-is-proper-fraction.js
> <#335 (comment)>
> :
>
> > \ No newline at end of file
> +function isProperFraction(numerator, denominator) {
>
> This function is declared twice now, I think you need to remove the
> example declaration or replace it with yours.
> ------------------------------
>
> In Sprint-3/3-mandatory-practice/implement/count.js
> <#335 (comment)>
> :
>
> > @@ -1,5 +1,14 @@
> -function countChar(stringOfCharacters, findCharacter) {
> - return 5
> +function countChar(str, char) {
> + console.log(`str: '${str}', char: '${char}', char length: ${char.length}`);
>
> Once you've finished debugging, you can clean up the code by removing
> extra console statements
> ------------------------------
>
> In Sprint-3/3-mandatory-practice/implement/get-ordinal-number.test.js
> <#335 (comment)>
> :
>
> > - });
> + expect(getOrdinalNumber(1)).toEqual("1st");
> +});
> +
> +test("should return '10th' for 10", () => {
> + expect(getOrdinalNumber(10)).toEqual("10th");
> +});
> +test("should return '42nd' for 42", () => {
> + expect(getOrdinalNumber(42)).toBe("42nd");
> +});
> +
> +test("should return '63rd' for 63", () => {
> + expect(getOrdinalNumber(63)).toBe("63rd");
> +});
> +
> +test("should return '63d' for 63", () => {
>
> I think this is a duplicate of the test above
>
> —
> Reply to this email directly, view it on GitHub
> <#335 (review)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/BM6WKVE5BJPU6Y42PY5OOND2TCT6TAVCNFSM6AAAAABX37JVJCVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDMNRVGM2TMOBVHA>
> .
> You are receiving this because you authored the thread.Message ID:
> <CodeYourFuture/Module-Structuring-and-Testing-Data/pull/335/review/2665356858
> @github.com>
>
|
|
Thanks @Priscilla-EM, it looks good, you can mark as Complete if you're happy with your work |
Author
|
Thank you
…On Wed, 12 Mar 2025, 14:46 Suzie Brown, ***@***.***> wrote:
Thanks @Priscilla-EM <https://github.com/Priscilla-EM>, it looks good,
you can mark as Complete if you're happy with your work
—
Reply to this email directly, view it on GitHub
<#335 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BM6WKVDBOYNRUPMHAXNJLYD2UBCGBAVCNFSM6AAAAABX37JVJCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMJYGE2DIMJUG4>
.
You are receiving this because you were mentioned.Message ID:
<CodeYourFuture/Module-Structuring-and-Testing-Data/pull/335/c2718144147@
github.com>
[image: suziebrown]*suziebrown* left a comment
(CodeYourFuture/Module-Structuring-and-Testing-Data#335)
<#335 (comment)>
Thanks @Priscilla-EM <https://github.com/Priscilla-EM>, it looks good,
you can mark as Complete if you're happy with your work
—
Reply to this email directly, view it on GitHub
<#335 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BM6WKVDBOYNRUPMHAXNJLYD2UBCGBAVCNFSM6AAAAABX37JVJCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMJYGE2DIMJUG4>
.
You are receiving this because you were mentioned.Message ID:
<CodeYourFuture/Module-Structuring-and-Testing-Data/pull/335/c2718144147@
github.com>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Learners, PR Template
Self checklist
Changelist
Briefly explain your PR.
Questions
Ask any questions you have for your reviewer.