Skip to content

London | 26-ITP-May | Khaliun Baatarkhuu | Sprint 3 | Implement and Rewrite Tests #1440

Open
khaliun-dev wants to merge 8 commits into
CodeYourFuture:mainfrom
khaliun-dev:coursework/sprint-3-implement-and-rewrite
Open

London | 26-ITP-May | Khaliun Baatarkhuu | Sprint 3 | Implement and Rewrite Tests #1440
khaliun-dev wants to merge 8 commits into
CodeYourFuture:mainfrom
khaliun-dev:coursework/sprint-3-implement-and-rewrite

Conversation

@khaliun-dev

Copy link
Copy Markdown

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

Changelist

  • learnt how to write test code using Jest
  • worked on three scenarios where i had to implement code given certain parameters
  • deepened my knowledge about various functions

Questions

None.

Implemented the getAngleType function to classify angles and added tests for various angle types.
Added additional tests for angle types including acute, right, obtuse, straight, reflex, and invalid angles.
Implemented the isProperFraction function and added tests for various cases.
Implemented the getCardValue function to return the value of a card based on its rank and suit. Added assertions to test valid card values and handle errors for invalid cards.
Added additional test cases for invalid card values to ensure proper error handling.
Added comprehensive Jest tests for the isProperFraction function, covering special cases, positive and negative proper and improper fractions.
Updated test cases for getCardValue function to use Jest syntax, covering all card types including Aces, number cards, face cards, and invalid cards.
@khaliun-dev khaliun-dev added 📅 Sprint 3 Assigned during Sprint 3 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Structuring-And-Testing-Data The name of the module. labels Jul 2, 2026

@LonMcGregor LonMcGregor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good start, but still some things to work on

`Expected ${actualOutput} to equal ${targetOutput}`
);
}
assertEquals(isProperFraction(1, 2), true);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Does your testing consider valid proper fractions with negatives?

}
const suits = ["♠", "♥", "♦", "♣"];

const values = {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is an interesting approach, good idea

const isProperFraction = require("../implement/2-is-proper-fraction");

// TODO: Write tests in Jest syntax to cover all combinations of positives, negatives, zeros, and other categories.
// Special case: denominator is zero

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Be careful here in your tests - have you tried running them with npm test? Can you see what is missing?

@LonMcGregor LonMcGregor added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Structuring-And-Testing-Data The name of the module. Reviewed Volunteer to add when completing a review with trainee action still to take. 📅 Sprint 3 Assigned during Sprint 3 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants