Skip to content

London | ITP-May-2025 | Surafel Workneh| Sprint-3 #637

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
wants to merge 28 commits into
base: main
Choose a base branch
from

Conversation

SuWebOnes
Copy link

No description provided.

SuWebOnes added 19 commits July 3, 2025 00:44
…add tests for zero numerator and denominator
…, and invalid inputs with corresponding tests
…s for numerator and denominator, ensuring proper fraction validation
@SuWebOnes SuWebOnes added Needs Review Participant to add when requesting review 🏕 Priority Mandatory This work is expected labels Jul 3, 2025
@SuWebOnes SuWebOnes changed the base branch from main to to-be-deleted-coursework/sprint-3 July 4, 2025 22:34
@SuWebOnes SuWebOnes changed the base branch from to-be-deleted-coursework/sprint-3 to main July 4, 2025 22:42
@Pappyjay157 Pappyjay157 self-assigned this Jul 10, 2025
filePath.slice(0, lastSlashIndex);

filePath

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Surafel,I noticed filePath, lastSlashIndex, and base are used without being declared earlier in the code. You’ll need to define those variables before using them so the rest of your logic works correctly.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to clean this code which shouldn’t be in sprint-3 at the first. so I will correct and push in sprint-1

// ====> write your test here, and then add a line to pass the test in the function above

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Surafel, good work on this. Just check that your function returns something for angles like 360 or any number outside 0 to 360. Right now, it doesn’t handle those cases.

@@ -8,7 +8,8 @@
// write one test at a time, and make it pass, build your solution up methodically

function isProperFraction(numerator, denominator) {
if (numerator < denominator) return true;
// if (numerator < denominator) return true; it will not work for negative numbers

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

your function should also check if the denominator is zero. If it is, the function should return false because a fraction cannot have a zero as the denominator. Try adding that check. Keep going, you are doing well!

const rank = card.slice(0, -1); // Extract rank (everything except the last character)
if (rank === "A") return 11; // handle Ace as 11
if (["K", "Q", "J"].includes(rank)) return 10; // handle face cards as 10
const numerincRank = parseInt(rank); //Handle number cards 2–9
Copy link

@Pappyjay157 Pappyjay157 Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a typo in numerincRank , it should be numericRank.

expect(count).toEqual(0);
});

module.exports = countChar;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"module.exports = countChar;"
This line should not be in the test file. It is only needed in the main function file where the function is defined.

@@ -9,5 +9,6 @@ const getOrdinalNumber = require("./get-ordinal-number");
// Then the function should return "1st"

test("should return '1st' for 1", () => {
expect(getOrdinalNumber(1)).toEqual("1st");
});
expect(getOrdinalNumber(1)).toEqual("1st");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your test is almost correct, but it’s missing the required import of the getOrdinalNumber function

// case: Negative Count:
// Given a target string str and a negative integer count,
// When the repeat function is called with these inputs,
// Then it should throw an error or return an appropriate error message, as negative counts are not valid.
console.log(repeat("hello", -3)); // Expected: "Error: Count must be a non-negative integer"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job testing count values like 1, 0, and negatives. Try using test() and expect() instead of console.log for proper Jest tests.

expect(result).toEqual(true);
});
expect(result).toEqual(true);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice start! You can remove the extra require and expect lines. Also try adding tests for other rules like missing symbols or reused passwords.

cleaning the comments of sprint-1 works on sprint-3
spelling correcetion
add condition to heck if denominator is zero
cleaning code line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review Participant to add when requesting review 🏕 Priority Mandatory This work is expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants