Skip to content

Cape Town | 26-ITP-Sept | Leigh Ross | Sprint 2 | Implement and rewrite tests - #1683

Open
leigh-ross wants to merge 4 commits into
CodeYourFuture:mainfrom
leigh-ross:coursework/sprint-2-implement-and-rewrite
Open

leigh-ross wants to merge 4 commits into
CodeYourFuture:mainfrom
leigh-ross:coursework/sprint-2-implement-and-rewrite

Conversation

@leigh-ross

Copy link
Copy Markdown

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Task code

CYF-1059

Changelist

Added 3 functions:

  • getAngleType
  • isProperFraction
  • getCardValue
    Added node tests for each Function.
    Rewrote node tests for jest.

@leigh-ross leigh-ross added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 12, 2026
@Liam310 Liam310 added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Oct 12, 2026
assert.equal(angleValue, "Straight angle");
});

describe ("Acute angles and boundaries", () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice use of describe to group related tests!


export function isProperFraction(numerator, denominator) {
// TODO: Implement this function
return (numerator >= 0) && numerator < denominator

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think we want to restrict proper fractions to be only the positive ones.

How can we deal with this in the solution?

Note: make sure there is adequate test coverage for this case also.

Comment on lines +63 to +66
describe ("Negative numerator", () => {
test("-98/100", () => {
assert.equal(isProperFraction(-98, 100), false);
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Refer to other comment - make sure we update our test suite to account for the corrected understanding of whether negative fractions can be proper.

@Liam310 Liam310 added Reviewed Volunteer to add when completing a review with trainee action still to take. Complete Volunteer to add when work is complete and all review comments have been addressed. Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. Reviewed Volunteer to add when completing a review with trainee action still to take. Complete Volunteer to add when work is complete and all review comments have been addressed. Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants